feat: begin back end

This commit is contained in:
Alessandre Laguierce 2024-10-23 15:55:36 +02:00
commit fdcb2bda88
4 changed files with 47 additions and 0 deletions

3
back-end/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
node_modules
package-lock.json
dist/

22
back-end/package.json Normal file
View File

@ -0,0 +1,22 @@
{
"name": "back-end",
"version": "1.0.0",
"main": "dist/app.js",
"scripts": {
"start": "tsc && node dist/app.js",
"build": "tsc",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"devDependencies": {
"@types/express": "^5.0.0",
"globals": "^15.11.0",
"typescript": "^5.6.3"
},
"dependencies": {
"express": "^4.21.1"
}
}

11
back-end/src/app.ts Normal file
View File

@ -0,0 +1,11 @@
import express from 'express';
const app = express();
const port = 3000;
app.get('/', (req, res) => {
res.send('Hello World!');
});
app.listen(port, () => {
return console.log(`Express is listening at http://localhost:${port}`);
});

11
back-end/tsconfig.json Normal file
View File

@ -0,0 +1,11 @@
{
"compilerOptions": {
"module": "commonjs",
"esModuleInterop": true,
"target": "es6",
"moduleResolution": "node",
"sourceMap": true,
"outDir": "dist"
},
"lib": ["es2015"]
}