Skip to content
Snippets Groups Projects
Verified Commit 3967f728 authored by Fredrik Fonn Hansen's avatar Fredrik Fonn Hansen :8ball:
Browse files

Created a simple express project

parent 2b24874a
No related branches found
No related tags found
1 merge request!2Resolve "Setup a simple Express project"
node_modules/
npm-debug.log
dist/
\ No newline at end of file
# Backend
This backend handles connection with the database and ongoing gameStates.
The backend uses the express framework to handle requests.
Implemation in Typescript.
Package handler is Yarn.
## How to run
Run the following commands in your terminal:
- yarn
- yarn start
{
"name": "backend",
"version": "0.0.1",
"description": "The backend handles gameStates and database connections",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "tsc && node dist/index.js"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@types/express": "^4.17.17",
"express": "^4.18.2",
"typescript": "^4.9.5"
}
}
import express from 'express';
const app = express();
const port = 3000;
app.get('/', (req, res) => {
res.send('Hello, World!');
});
app.listen(port, () => {
console.log(`Server started on port ${port}`);
});
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"esModuleInterop": true,
"outDir": "dist",
"strict": true,
"sourceMap": true
},
"include": ["src/**/*"]
}
\ No newline at end of file
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment