wip install prettier and format

This commit is contained in:
lebaudantoine
2024-10-21 00:52:31 +02:00
parent 89a44e4979
commit a1c497ef27
4 changed files with 45 additions and 21 deletions
+5
View File
@@ -0,0 +1,5 @@
{
"semi": false,
"trailingComma": "es5",
"singleQuote": true
}
+19 -3
View File
@@ -15,9 +15,10 @@
"devDependencies": {
"@types/express": "5.0.0",
"@types/node": "22.7.7",
"concurrently": "^9.0.1",
"nodemon": "^3.1.7",
"ts-node": "^10.9.2",
"concurrently": "9.0.1",
"nodemon": "3.1.7",
"prettier": "3.3.3",
"ts-node": "10.9.2",
"typescript": "5.6.3"
}
},
@@ -1167,6 +1168,21 @@
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/prettier": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz",
"integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==",
"dev": true,
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
},
"node_modules/proxy-addr": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
+5 -2
View File
@@ -12,7 +12,9 @@
"build": "npx tsc",
"start": "node dist/index.js",
"dev": "nodemon src/index.ts",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"format": "prettier --write ./src",
"check": "prettier --check ./src"
},
"dependencies": {
"dotenv": "16.4.5",
@@ -24,6 +26,7 @@
"concurrently": "9.0.1",
"nodemon": "3.1.7",
"ts-node": "10.9.2",
"typescript": "5.6.3"
"typescript": "5.6.3",
"prettier": "3.3.3"
}
}
+16 -16
View File
@@ -1,23 +1,23 @@
import express, { Express, Request, Response } from "express";
import dotenv from "dotenv";
import express, { Express, Request, Response } from 'express'
import dotenv from 'dotenv'
dotenv.config();
dotenv.config()
const app: Express = express();
const port = process.env.PORT ?? 8081;
const app: Express = express()
const port = process.env.PORT ?? 8081
app.get("/", (req: Request, res: Response) => {
res.send("Express + TypeScript Server");
});
app.get('/', (req: Request, res: Response) => {
res.send('Express + TypeScript Server')
})
app.get("/__heartbeat__", (req: Request, res: Response) => {
res.status(200).send({ status: "OK" });
});
app.get('/__heartbeat__', (req: Request, res: Response) => {
res.status(200).send({ status: 'OK' })
})
app.get("/__lbheartbeat__", (req: Request, res: Response) => {
res.status(200).send({ status: "OK" });
});
app.get('/__lbheartbeat__', (req: Request, res: Response) => {
res.status(200).send({ status: 'OK' })
})
app.listen(port, () => {
console.log(`[server]: Server is running at http://localhost:${port}`);
});
console.log(`[server]: Server is running at http://localhost:${port}`)
})