Workstations Service

This commit is contained in:
Henrik Brüsecke 2026-08-29 18:18:56 +03:00
parent 9a2bd2bffd
commit ed13bec66f
6 changed files with 92 additions and 1 deletions

View file

@ -0,0 +1,30 @@
import http from 'node:http';
const PORT = 50000;
const server = http.createServer(onRequest);
let isShuttingDown = false;
process.on('SIGINT', shutdown);
process.on('SIGTERM', shutdown);
server.listen(PORT);
console.log('Started server')
console.log(`Listening on port ${PORT}`);
function onRequest(_request, response) {
response.setHeader('Content-Type', 'application/json');
response.end(JSON.stringify({}));
}
function onServerClose() {
console.log('Server shutdown');
}
function shutdown() {
if (isShuttingDown) return;
console.log('Shutting down server');
isShuttingDown = true;
server.close(onServerClose);
}