B
B
babbert2019-04-26 11:35:21
Node.js
babbert, 2019-04-26 11:35:21

How to make an application run until kill?

Hello.
There is a code: But after execution, the application closes immediately. How can I make it close only on process.exit();
console.log(5)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Shvets, 2019-04-26
@babbert

setInterval(() => {}, 999999); // чтоб само не завершалось
process.on('SIGTERM', () => {}); // чтобы по ctrl-c не убивалось

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question