21 lines
496 B
JavaScript
21 lines
496 B
JavaScript
import { createApp } from "./app.js";
|
|
import { loadConfig } from "./config.js";
|
|
|
|
const config = loadConfig();
|
|
const app = createApp(config);
|
|
|
|
const server = app.listen(config.port, config.host, () => {
|
|
console.log(`suwayomi-rss listening on http://${config.host}:${config.port}`);
|
|
});
|
|
|
|
for (const signal of ["SIGINT", "SIGTERM"]) {
|
|
process.on(signal, () => {
|
|
server.close((error) => {
|
|
if (error) {
|
|
console.error(error);
|
|
process.exitCode = 1;
|
|
}
|
|
});
|
|
});
|
|
}
|