Skip to content

Commit a17ecfb

Browse files
committed
feat: add server file and app js with express and cors imports to start server
1 parent 8c164dc commit a17ecfb

2 files changed

Lines changed: 17 additions & 2 deletions

File tree

server.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
// server.js
1+
import app from './src/app.js';
2+
3+
const PORT = process.env.PORT || 3000;
4+
5+
app.listen(PORT, () => {
6+
console.log(`Server is running on port ${PORT}`);
7+
});

src/app.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
// main application file
1+
import express from 'express';
2+
import cors from 'cors';
3+
4+
const app = express();
5+
6+
app.use(cors());
7+
app.use(express.json());
8+
9+
export default app
10+

0 commit comments

Comments
 (0)