mirror of
https://git.roussel.pro/telecom-paris/pact.git
synced 2026-02-09 18:40:17 +01:00
ajout du support pour les réseaux sociaux
This commit is contained in:
17
code/server/index.js
Normal file
17
code/server/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import * as dotenv from 'dotenv';
|
||||
import express from 'express';
|
||||
import bodyParser from 'body-parser';
|
||||
import { addReviewFromRequest } from './borne/handler.js';
|
||||
import { addSocialReviewFromRequest } from './reseaux_sociaux/handler.js';
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(bodyParser.urlencoded({extended:true}))
|
||||
dotenv.config()
|
||||
app.post('/add_review', (req,res) => addReviewFromRequest(req,res));
|
||||
app.post('/add_social_review', (req,res) => addSocialReviewFromRequest(req,res));
|
||||
|
||||
app.listen(process.env.PORT, () => {
|
||||
console.log("Server démaré sur le port " + process.env.PORT)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user