Last active
January 4, 2023 10:15
-
-
Save benjaminudoh10/d95bffab7cd33e415d2de9de3001f82c to your computer and use it in GitHub Desktop.
Bullqueue blog - App instantiation
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
import express, { Request, Response } from 'express'; | |
const app = express(); | |
app.use(express.json()); | |
app.get('/health', (request: Request, response: Response) => { | |
response | |
.status(200) | |
.json({ | |
message: 'Works as expected', | |
info: { | |
url: `${request.protocol}://${request.hostname}${request.path}`, | |
}, | |
}) | |
.end(); | |
}); | |
export { app }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment