Skip to content

Instantly share code, notes, and snippets.

@yostane
Last active March 7, 2023 15:05
Show Gist options
  • Select an option

  • Save yostane/c568d7dc2b228cb221b8627a0f2decc7 to your computer and use it in GitHub Desktop.

Select an option

Save yostane/c568d7dc2b228cb221b8627a0f2decc7 to your computer and use it in GitHub Desktop.
ts project
const x = 10;
const y = 20;
function add(x: number, y: number): number {
return x + y;
}
console.log(add(x, y));
import express from "express";
const app = express();
app.get("/", (req, res) => res.send("Hello"));
app.listen(3000, () => console.log("Serveur démarré"));
{
"name": "nodemon_ts",
"version": "1.0.0",
"description": "TS + express project",
"scripts": {
"start": "nodemon --watch src -e ts --exec ts-node src/main.ts",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2",
"ts-node": "^10.9.1"
},
"devDependencies": {
"@types/express": "^4.17.17",
"nodemon": "^2.0.21"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment