This commit is contained in:
parent
89d1617c3b
commit
3d0c113c83
|
|
@ -8,6 +8,7 @@
|
||||||
"update": "git pull origin main && npm run db-migrate && npm run db-types",
|
"update": "git pull origin main && npm run db-migrate && npm run db-types",
|
||||||
"clean": "npm run lint:fix && npm run format:write",
|
"clean": "npm run lint:fix && npm run format:write",
|
||||||
"dev": "next dev -H 0.0.0.0",
|
"dev": "next dev -H 0.0.0.0",
|
||||||
|
"prebuild": "node scripts/generate-env.js",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start -H 0.0.0.0 -p 3030",
|
"start": "next start -H 0.0.0.0 -p 3030",
|
||||||
"start:prod": "npm run build && pm2 start npm --name \"chatai-ui\" -- run start",
|
"start:prod": "npm run build && pm2 start npm --name \"chatai-ui\" -- run start",
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
// scripts/generate-env.js
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const env = {
|
||||||
|
SUPABASE_URL: process.env.SUPABASE_URL || "http://localhost:8000",
|
||||||
|
OLLAMA_URL: process.env.OLLAMA_URL || "http://localhost:11434"
|
||||||
|
};
|
||||||
|
|
||||||
|
const content = `window.RUNTIME_ENV = ${JSON.stringify(env, null, 2)};`
|
||||||
|
|
||||||
|
fs.writeFileSync("public/env.js", content);
|
||||||
Loading…
Reference in New Issue