From fdcb2bda888d344c6c1bfaba3ef04c86e8428510 Mon Sep 17 00:00:00 2001 From: Alessandre Laguierce Date: Wed, 23 Oct 2024 15:55:36 +0200 Subject: [PATCH] feat: begin back end --- back-end/.gitignore | 3 +++ back-end/package.json | 22 ++++++++++++++++++++++ back-end/src/app.ts | 11 +++++++++++ back-end/tsconfig.json | 11 +++++++++++ 4 files changed, 47 insertions(+) create mode 100644 back-end/.gitignore create mode 100644 back-end/package.json create mode 100644 back-end/src/app.ts create mode 100644 back-end/tsconfig.json diff --git a/back-end/.gitignore b/back-end/.gitignore new file mode 100644 index 0000000..9785372 --- /dev/null +++ b/back-end/.gitignore @@ -0,0 +1,3 @@ +node_modules +package-lock.json +dist/ \ No newline at end of file diff --git a/back-end/package.json b/back-end/package.json new file mode 100644 index 0000000..e40a506 --- /dev/null +++ b/back-end/package.json @@ -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" + } +} diff --git a/back-end/src/app.ts b/back-end/src/app.ts new file mode 100644 index 0000000..bd7c445 --- /dev/null +++ b/back-end/src/app.ts @@ -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}`); +}); diff --git a/back-end/tsconfig.json b/back-end/tsconfig.json new file mode 100644 index 0000000..d58a717 --- /dev/null +++ b/back-end/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "module": "commonjs", + "esModuleInterop": true, + "target": "es6", + "moduleResolution": "node", + "sourceMap": true, + "outDir": "dist" + }, + "lib": ["es2015"] +}