Last active
June 21, 2018 13:22
-
-
Save nairihar/9e77d050031989597f62be468a844055 to your computer and use it in GitHub Desktop.
NodeJS Health Check and Overload Protection, medium
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
app.get('/', (req, res) => { | |
res.end(`Hello PID: ${process.pid}`); | |
}); | |
app.get('/check', (req, res) => { | |
console.log('Health Check Request'); | |
res.status(200).end(); | |
}); | |
app.listen(process.env.PORT); | |
console.log(`Api Server running on ${process.env.PORT} port, PID: ${process.pid}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment