Add the Sokko TCG collectible card mini-game
Add the server-backed card game: Discord login, recharging pack openings, album, trades, gifts, stardust shop, campaign codes and its administration, stored in SQLite and disabled in production until configured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
243465720f
commit
5ce35cd7ba
193 changed files with 12159 additions and 28 deletions
|
|
@ -2,13 +2,29 @@
|
|||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { loadProjectEnv } from "./scripts/load-project-env.mjs";
|
||||
import { createCardsApiHandler } from "./services/cards/api.js";
|
||||
import { resolve } from "node:path";
|
||||
|
||||
loadProjectEnv();
|
||||
|
||||
function nebulaCardsApi() {
|
||||
return {
|
||||
name: "nebula-cards-api",
|
||||
apply: "serve",
|
||||
configureServer(server) {
|
||||
const handler = createCardsApiHandler({ projectRoot: resolve("."), enabled: process.env.CARDS_ENABLED !== "false", devAuth: process.env.CARDS_DEV_AUTH !== "false", devPerks: true });
|
||||
server.middlewares.use(async (req, res, next) => {
|
||||
if (!await handler(req, res)) next();
|
||||
});
|
||||
server.httpServer?.once("close", handler.close);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export default defineConfig({
|
||||
root: "website",
|
||||
publicDir: "public",
|
||||
plugins: [react()],
|
||||
plugins: [react(), nebulaCardsApi()],
|
||||
server: {
|
||||
host: "0.0.0.0",
|
||||
port: Number(process.env.PORT || 5173)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue