-
Notifications
You must be signed in to change notification settings - Fork 25
Make it compatible with express #11
Comments
Here's what I do: require('systemd');
var app = express();
app.get('/test', function(req, res) {
return res.json('ok');
});
app.listen(process.env.LISTEN_PID > 0 ? 'systemd' : 3000); This works, so it should be compatible with express. |
yes it works with the above js. |
Found the issue: Let me document it here in hope of helping others
and my systemd service file was:
I guess npm is not passing the envs over to node instance? |
That's exactly the problem: npm isn't aware of the socket so it cannot hand Thanks for diving into this.
|
Wow, guys this took me ages to find. Thanks. Maybe it should be in the README file. |
👍 |
I tried integrating systemd socket activation with express app,
so in my express app.js,
I received the following error,
I digged around a bit but have no idea, it seems that process.env.LISTEN_FDS is mysteriously gone in systemd.js
The text was updated successfully, but these errors were encountered: