const express = require('express');
const server= express();
const bd = require('body-parser');
const cors = require('cors');
server.use(cors());
server.use(bd.json());
const routes = require('./routes')(server);

server.use(function (err, req, res, next) {
    if (err.status) {
        res.status(err.status).send(err.message);
    } else {
        res.status(500).send(err.message);
    }
});

server.listen(8000, function () {
    console.log('ouais ouais ouais !!!');
});
