Add more routes

This commit is contained in:
Akshay
2023-10-08 19:56:27 +05:30
parent 6f634c3f13
commit 8c7da0bdb6
3 changed files with 242 additions and 232 deletions

View File

@@ -7,8 +7,17 @@ const router = jsonServer.router('./src/mocks/db.json');
const middlewares = jsonServer.defaults();
server.use(middlewares);
server.use(jsonServer.rewriter(routes));
server.use((req, res, next) => {
if (req.method === 'POST') {
if (req.url.includes('/delete_conversation')) {
req.method = 'DELETE';
}
}
next()
})
server.use(jsonServer.rewriter(routes));
server.use(router);