diff --git a/db/demo_kuma.db b/db/demo_kuma.db new file mode 100644 index 000000000..2042fcf2f Binary files /dev/null and b/db/demo_kuma.db differ diff --git a/package.json b/package.json index f279351ec..9d6ca25d7 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,6 @@ "dev": "vite --host", "start": "npm run start-server", "start-server": "node server/server.js", - "start-demo-server": "set NODE_ENV=demo && node server/server.js", - "update": "", "build": "vite build", "vite-preview-dist": "vite preview --host", "build-docker": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma -t louislam/uptime-kuma:1 -t louislam/uptime-kuma:1.5.2 --target release . --push", diff --git a/server/server.js b/server/server.js index 39191de79..3387631c3 100644 --- a/server/server.js +++ b/server/server.js @@ -50,6 +50,14 @@ const port = parseInt(process.env.PORT || args.port || 3001); const sslKey = process.env.SSL_KEY || args["ssl-key"] || undefined; const sslCert = process.env.SSL_CERT || args["ssl-cert"] || undefined; +// Demo Mode? +const demoMode = args["demo"] || false; + +if (demoMode) { + console.log("==== Demo Mode ===="); + Database.templatePath = "./demo_kuma.db"; +} + // Data Directory (must be end with "/") Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data/"; Database.path = Database.dataDir + "kuma.db";