Created file structure and initialized express.js backend

This commit is contained in:
2024-04-22 11:41:41 +03:00
parent 71db0bea97
commit 14456c5ab4
2 changed files with 29 additions and 0 deletions

14
app/backend/index.js Normal file
View 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
View 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"
}
}