You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
659 B

import 'dotenv/config';
import { handler } from '../build/handler.js';
import { createStore } from './store.mjs';
import { createService } from './service.mjs';
const store = await createStore();
const service = createService(store, process.env, handler);
const host = process.env.HOST || '0.0.0.0';
const port = Number(process.env.PORT || 3000);
service.server.listen(port, host, () =>
console.log(`Juegoland · web, API y WebSockets en ${host}:${port}`),
);
let stopping = false;
async function stop() {
if (stopping) return;
stopping = true;
await service.close();
await store.close();
}
process.on('SIGINT', stop);
process.on('SIGTERM', stop);

Powered by TurnKey Linux.