17 lines
326 B
JavaScript
17 lines
326 B
JavaScript
const PrintServer = require('./print-server');
|
|
|
|
async function main() {
|
|
const printServer = new PrintServer();
|
|
await printServer.start();
|
|
|
|
process.on('SIGINT', async function() {
|
|
console.log('Got SIGINT.');
|
|
try {
|
|
await printServer.stop();
|
|
} catch (err) {
|
|
console.error(err);
|
|
}
|
|
process.exit();
|
|
});
|
|
}
|
|
main(); |