Initial LisgloSIPS V2 implementation

This commit is contained in:
hectorzhao
2026-06-22 10:56:38 +08:00
commit 5fa1bd35e9
303 changed files with 35644 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import { createServer } from 'node:http';
const host = process.env.HOST || '127.0.0.1';
const port = Number.parseInt(process.env.PORT || '3000', 10);
const server = createServer((request, response) => {
response.setHeader('Content-Type', 'application/json; charset=utf-8');
response.setHeader('Cache-Control', 'no-store');
response.setHeader('X-Content-Type-Options', 'nosniff');
if (request.method === 'GET' && (request.url === '/healthz' || request.url === '/api/health')) {
response.writeHead(200);
response.end(JSON.stringify({ status: 'ok', service: 'lisglosips-api-placeholder' }));
return;
}
response.writeHead(404);
response.end(JSON.stringify({ status: 'not_found' }));
});
server.listen(port, host);
function shutdown() {
server.close((error) => process.exit(error ? 1 : 0));
setTimeout(() => process.exit(1), 10_000).unref();
}
process.on('SIGTERM', shutdown);
process.on('SIGINT', shutdown);