Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require('express')
- const app = express()
- const bodyParser = require('body-parser')
- //module
- const routes = require('./routes/index')
- const users = require('./routes/users')
- app.use(bodyParser.json()) // for parsing application/json
- app.use(bodyParser.urlencoded({ extended: true })) // for parsing application/x-www-form-urlencoded
- app.use('/', routes)
- app.use('/users', users)
- // check opening server
- const port = () => console.log("Mon serveur ecoute sur le port 3000")
- // server listen
- app.listen(3000, port)
Add Comment
Please, Sign In to add comment