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" ;
7
7
8
8
const envFilePath = path . join (
9
9
path . resolve ( path . dirname ( path . dirname ( __dirname ) ) ) ,
@@ -15,12 +15,12 @@ const swaggerDocument = yaml.parse(file);
15
15
16
16
dotenv . config ( { path : envFilePath } ) ;
17
17
18
- const app = express ( ) ;
18
+ const app : Express = express ( ) ;
19
19
20
20
const PORT = process . env . QUESTION_SERVICE_PORT || 3000 ;
21
21
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" } ) ;
24
24
} ) ;
25
25
26
26
app . use ( "/docs" , swaggerUi . serve , swaggerUi . setup ( swaggerDocument ) ) ;
0 commit comments