Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
# Keep environment variables out of version control
.env

/generated/prisma
Binary file removed Nodejs-Express-Api.pdf
Binary file not shown.
16 changes: 16 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import express from 'express';
import orderRoutes from './src/routes/orderRoutes.js';

const app = express();
const PORT = 3000;

// Middleware to parse JSON bodies
app.use(express.json());

// Use the order routes, prefixing all paths with /api/orders
app.use('/api/orders', orderRoutes);

// Start the server
app.listen(PORT, () => {
console.log(`Order API running on http://localhost:${PORT}/api/orders`);
});
Loading