2 changed files with 18 additions and 1 deletions
@ -0,0 +1,10 @@ |
|||||
|
const express = require('express'); |
||||
|
const app = express(); |
||||
|
|
||||
|
app.use((req, res, next) => { |
||||
|
res.status(200).json({ |
||||
|
message: "C'est bon!" |
||||
|
}); // pour envoyer une json response 200
|
||||
|
}); |
||||
|
|
||||
|
module.exports = app; |
@ -1 +1,8 @@ |
|||||
const http = require('http'); |
const http = require('http'); |
||||
|
const app = require('./app'); |
||||
|
|
||||
|
const port = process.env.PORT || 3000; |
||||
|
|
||||
|
const server = http.createServer(app); |
||||
|
|
||||
|
server.listen(port); |
Loading…
Reference in new issue