Refine and cleanup
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
import express from 'express';
|
||||
import cors from 'cors';
|
||||
import notesRoutes from './routes/notes.routes.js';
|
||||
import router from './routes/notes.routes.js';
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(cors());
|
||||
app.use(express.json());
|
||||
|
||||
app.use('/v1/notes', notesRoutes);
|
||||
app.use('/v1/notes', router);
|
||||
|
||||
app.use((req, res) => {
|
||||
res.status(404).json({ error: `Requested path is invalid or does not exist: ${req.method} ${req.originalUrl}` });
|
||||
|
||||
Reference in New Issue
Block a user