-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
While this works as expected when we do not provide any argument it stops immediately after starting
$> node index.js start
/home/xx/sources/scratch/node/start-stop/index.js
Starting sampleapp daemon...
sampleapp daemon stopped.
index.js:
const express = require('express')
const deamonize = require("daemonize2")
const app = express()
console.log(__filename)
const daemon = deamonize.setup({
main: __filename,
name: "sampleapp",
pidfile: "sampleapp.pid"
});
switch (process.argv[2]) {
case "start":
daemon.start()
break
case "stop":
daemon.stop()
break
default:
app.get('/', (req, res) => res.send('Hello World!'))
app.listen(3000)
}
Metadata
Metadata
Assignees
Labels
No labels