Skip to content

Commit 126e4eb

Browse files
committed
style: run prettier format on index.ts
The file wasn't prettier formatted yet and making a change to it would result in a huge diff with 99% styling changes.
1 parent 812ffde commit 126e4eb

File tree

1 file changed

+24
-30
lines changed

1 file changed

+24
-30
lines changed

src/index.ts

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,57 @@
1-
import './instrument.js';
2-
import express, {type Express} from "express";
1+
import "./instrument.js";
2+
import express, { type Express } from "express";
33
import "reflect-metadata";
44
import cors from "cors";
5-
import {assertExists} from "./utils/assertExists.js";
6-
import {yoga} from "./client/graphql.js";
5+
import { assertExists } from "./utils/assertExists.js";
6+
import { yoga } from "./client/graphql.js";
77
import swaggerUi from "swagger-ui-express";
8-
import swaggerJson from "./__generated__/swagger.json" assert {type: "json"}
9-
import {RegisterRoutes} from "./__generated__/routes/routes.js";
10-
import * as Sentry from '@sentry/node';
8+
import swaggerJson from "./__generated__/swagger.json" assert { type: "json" };
9+
import { RegisterRoutes } from "./__generated__/routes/routes.js";
10+
import * as Sentry from "@sentry/node";
1111

1212
// @ts-expect-error BigInt is not supported by JSON
1313
BigInt.prototype.toJSON = function () {
14-
const int = Number.parseInt(this.toString());
15-
return int ?? this.toString();
14+
const int = Number.parseInt(this.toString());
15+
return int ?? this.toString();
1616
};
1717

1818
// @ts-expect-error BigInt is not supported by JSON
1919
BigInt.prototype.fromJSON = function () {
20-
return BigInt(this.toString());
20+
return BigInt(this.toString());
2121
};
2222

2323
const PORT = assertExists(process.env.PORT, "PORT");
2424

2525
const app: Express = express();
2626

27-
app.use(express.urlencoded({extended: true, limit: '1mb'}));
28-
app.use(express.json({limit: '1mb'}));
27+
app.use(express.urlencoded({ extended: true, limit: "1mb" }));
28+
app.use(express.json({ limit: "1mb" }));
2929
app.use(cors());
3030

31-
app.get('/health', (req, res) => {
32-
const data = {
33-
uptime: process.uptime(),
34-
message: 'OK',
35-
date: new Date()
36-
}
31+
app.get("/health", (req, res) => {
32+
const data = {
33+
uptime: process.uptime(),
34+
message: "OK",
35+
date: new Date(),
36+
};
3737

38-
res.status(200).send(data);
38+
res.status(200).send(data);
3939
});
4040

4141
// Bind GraphQL Yoga to the graphql endpoint to avoid rendering the playground on any path
4242
app.use(yoga.graphqlEndpoint, yoga);
4343

44-
app.use(
45-
"/spec",
46-
swaggerUi.serve,
47-
swaggerUi.setup(swaggerJson)
48-
);
44+
app.use("/spec", swaggerUi.serve, swaggerUi.setup(swaggerJson));
4945

5046
RegisterRoutes(app);
5147

5248
// The error handler must be registered before any other error middleware and after all controllers
5349
Sentry.setupExpressErrorHandler(app);
5450

5551
app.listen(PORT, () => {
56-
console.log(
57-
`🕸️ Running a GraphQL API server at http://localhost:${PORT}/v1/graphql`
58-
);
59-
60-
console.log(`🚀 Running Swagger docs at http://localhost:${PORT}/spec`);
52+
console.log(
53+
`🕸️ Running a GraphQL API server at http://localhost:${PORT}/v1/graphql`,
54+
);
6155

56+
console.log(`🚀 Running Swagger docs at http://localhost:${PORT}/spec`);
6257
});
63-

0 commit comments

Comments
 (0)