Skip to content

Commit cdb904e

Browse files
committed
Convert to typescript
1 parent 749ebfa commit cdb904e

File tree

6 files changed

+5545
-1398
lines changed

6 files changed

+5545
-1398
lines changed

backend/question-service/index.js renamed to backend/question-service/index.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
const express = require("express");
2-
const dotenv = require("dotenv");
3-
const path = require("path");
4-
const swaggerUi = require("swagger-ui-express");
5-
const yaml = require("yaml");
6-
const fs = require("fs");
1+
import express, { Express, Request, Response } from "express";
2+
import dotenv from "dotenv";
3+
import path from "path";
4+
import swaggerUi from "swagger-ui-express";
5+
import yaml from "yaml";
6+
import fs from "fs";
77

88
const envFilePath = path.join(
99
path.resolve(path.dirname(path.dirname(__dirname))),
@@ -15,12 +15,12 @@ const swaggerDocument = yaml.parse(file);
1515

1616
dotenv.config({ path: envFilePath });
1717

18-
const app = express();
18+
const app: Express = express();
1919

2020
const PORT = process.env.QUESTION_SERVICE_PORT || 3000;
2121

22-
app.get("/", (req, res) => {
23-
res.status(200).json({ message: "Hello World from question-service" });
22+
app.get("/", (req: Request, res: Response) => {
23+
res.status(200).json({ message: "Hello world from question service" });
2424
});
2525

2626
app.use("/docs", swaggerUi.serve, swaggerUi.setup(swaggerDocument));

0 commit comments

Comments
 (0)