add demo db

This commit is contained in:
LouisLam 2021-09-02 22:37:51 +08:00
parent f23ecef636
commit b1647a310e
3 changed files with 8 additions and 2 deletions

BIN
db/demo_kuma.db Normal file

Binary file not shown.

View File

@ -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",

View File

@ -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";