add TP1
This commit is contained in:
19
tp_wik_dps_01/server.js
Normal file
19
tp_wik_dps_01/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.get('/', (req, res) => {
|
||||
res.send('GUH')
|
||||
})
|
||||
|
||||
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