mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 16:43:16 +00:00
Add more routes
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user