Skip to content
This repository was archived by the owner on Jan 31, 2026. It is now read-only.
Merged
11 changes: 10 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ import { startup } from './src/utils/startup.js';
import { fileURLToPath } from 'url';

const PORT = process.env.PORT;
const allowedOrigins = process.env.ALLOWED_ORIGINS?.split(',') || []; // localhost is also allowed. (from any localhost port)
const parseAllowedOrigins = (allowedOrigins) => {
if (!allowedOrigins) return [];
const stripped = allowedOrigins.trim().replace(/^\[|\]$/g, '');
return stripped
.split(',')
.map((s) => s.trim().replace(/^\"|\"$|^\'|\'$/g, ''))
.filter(Boolean);
};
// localhost is also allowed. (from any localhost port)
const allowedOrigins = parseAllowedOrigins(process.env.ALLOWED_ORIGINS) || [];
const app = express();

app.use(
Expand Down
9 changes: 4 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"express": "^5.1.0",
"node-cache": "^5.1.2",
"node-fetch": "^3.3.2",
"prettier": "^3.6.2",
"prettier": "^3.7.3",
"unpacker": "^1.0.1",
"wyzie-lib": "^2.2.5"
},
Expand Down