Created file structure and initialized express.js backend
This commit is contained in:
14
app/backend/index.js
Normal file
14
app/backend/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
// backend/index.js
|
||||
const express = require('express');
|
||||
|
||||
const PORT = process.env.PORT || 3010;
|
||||
const app = express();
|
||||
|
||||
app.use((req, res, next) => {
|
||||
res.setHeader('Access-Control-Allow-Origin', '*');
|
||||
next();
|
||||
});
|
||||
|
||||
app.listen(PORT, () => {
|
||||
console.log(`Server listening on ${PORT}`);
|
||||
});
|
||||
15
app/backend/package.json
Normal file
15
app/backend/package.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "backend",
|
||||
"version": "1.0.0",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "node ./index.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"description": "",
|
||||
"dependencies": {
|
||||
"express": "^4.19.2"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user