add TP2
This commit is contained in:
19
tp_wik_dps_02/server.js
Normal file
19
tp_wik_dps_02/server.js
Normal file
@@ -0,0 +1,19 @@
|
||||
import dotenv from 'dotenv'
|
||||
import express from 'express'
|
||||
|
||||
dotenv.config()
|
||||
|
||||
const app = express()
|
||||
const port = process.env.PING_LISTEN_PORT
|
||||
|
||||
app.use((req, res) => {
|
||||
res.status(404);
|
||||
});
|
||||
|
||||
app.get('/ping', (req, res) => {
|
||||
res.json({ headers: req.headers })
|
||||
})
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`GUH is listening on port ${port}`)
|
||||
})
|
||||
Reference in New Issue
Block a user