Skip to content

Commit 510bd50

Browse files
committed
add .DS_Store files to track local directory settings
1 parent 6de2300 commit 510bd50

3 files changed

Lines changed: 292 additions & 196 deletions

File tree

code/henryogun-recipe-crud-app/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import express from 'express';
22
import mongoose from 'mongoose';
3+
import cors from 'cors';
34
import recipeRoutes from './routes/recipes.js';
45

56
const app = express();
@@ -9,6 +10,7 @@ const PORT = process.env.PORT || 3000;
910
const MONGODB_URI = 'mongodb://localhost:27017/recipes';
1011

1112
// Middleware
13+
app.use(cors()); // Enable CORS for all routes
1214
app.use(express.json());
1315
app.use(express.urlencoded({ extended: true }));
1416

0 commit comments

Comments
 (0)