One of the way is by using Control + c , but what we are you are getting here is we want to close our program programmatically. In order to achieve this we are going to use the process module present in NodeJS
. Lets see How and Is it a good way of doing it ?
const express = require('express')
const app = express()
app.get('/', (req, res) => {
res.send('Hi Nodejstuts!')
})
const server = app.listen(3000, () => console.log('Server Listening In Nodejstuts'))
Top comments (0)