add workflow
Some checks failed
Release Build / build-docker (push) Failing after 1m1s
Release Build / build-android-and-release (push) Has been skipped

This commit is contained in:
Rene Kievits
2025-12-24 07:51:51 +01:00
parent c140bb8292
commit 0b6146755d
5 changed files with 90 additions and 21 deletions

View File

@@ -11,21 +11,10 @@ const fastify = Fastify({ logger: true });
await connectDB();
const allowedOrigins = [
'http://192.168.0.26:5169',
'http://192.168.0.26:5173',
'http://localhost:5173',
'http://localhost',
'https://localhost',
'capacitor://localhost',
'https://10.0.2.2:5173',
'https://zenkanji.crylia.de'
process.env.SERVER_EXT_ACCESS,
process.env.SERVER_INT_ACCESS
];
if (process.env.CORS_ORIGINS) {
const prodOrigins = process.env.CORS_ORIGINS.split(',');
allowedOrigins.push(...prodOrigins);
}
await fastify.register(cors, {
origin: allowedOrigins,
methods: ['GET', 'POST', 'PUT', 'DELETE'],
@@ -67,7 +56,6 @@ await fastify.register(routes);
const start = async () => {
try {
await fastify.listen({ port: PORT, host: '0.0.0.0' });
console.log(`Server running at http://localhost:${PORT}`);
} catch (err) {
fastify.log.error(err);
process.exit(1);

View File

@@ -1,4 +1,3 @@
export const PORT = process.env.PORT || 3000;
export const MONGO_URI = process.env.MONGO_URI || 'mongodb://mongo:27017/zenkanji' || 'mongodb://192.168.0.26:27017/zenkanji';
export const SRS_TIMINGS_HOURS = [0, 2, 4, 8, 23, 47];
export const PORT = 3000;
export const MONGO_URI = process.env.MONGO_URI
export const JWT_SECRET = process.env.JWT_SECRET;