File size: 441 Bytes
6c30253
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { createApp } from './app.js';

const port = Number(process.env.PORT || 7860);
const { app } = createApp();
const server = app.listen(port, '0.0.0.0', () => {
  console.log(`[LFM WebGPU] listening on ${port}`);
});

function shutdown() {
  server.close(() => {
    process.exitCode = 0;
  });
  setTimeout(() => server.closeAllConnections?.(), 5_000).unref?.();
}

process.once('SIGINT', shutdown);
process.once('SIGTERM', shutdown);