Add healthcheck endpoints and scripts

This commit is contained in:
sid palas
2023-02-05 10:16:47 -05:00
parent af4bca05d0
commit 1ea6754c7f
14 changed files with 241 additions and 20 deletions

View File

@ -4,7 +4,7 @@ const express = require('express');
const morgan = require('morgan');
const app = express();
const port = 3000;
const port = process.env.PORT || 3000;
// setup the logger
app.use(morgan('tiny'));
@ -16,6 +16,10 @@ app.get('/', async (req, res) => {
res.send(response);
});
app.get('/ping', async (_, res) => {
res.send('pong');
});
const server = app.listen(port, () => {
console.log(`Example app listening on port ${port}`);
});