const jsonServer = require('json-server');
const server = jsonServer.create();
const router = jsonServer.router('./database.json');
const middlewares = jsonServer.defaults();
server.use(middlewares);
server.use(router);
server.listen(
    3000,
    () => {
        console.log('JSON server is running at port 3000');
    }
);