aboutsummaryrefslogtreecommitdiff
path: root/src/server.ts
diff options
context:
space:
mode:
authorRitesh Ghosh <[email protected]>2023-11-22 13:44:14 +0530
committerRitesh Ghosh <[email protected]>2023-11-22 13:44:14 +0530
commitf8e27d77d20f6c1f727785377bec6839d943abff (patch)
tree115d383bb8e5f4b0b12dbc7ae693061adf6c699c /src/server.ts
parent6573e8318abef3e4dbec4be5611421ff3418fd62 (diff)
downloadaniwatch-api-f8e27d77d20f6c1f727785377bec6839d943abff.tar.xz
aniwatch-api-f8e27d77d20f6c1f727785377bec6839d943abff.zip
fix(ts): file import types & static folder path
Diffstat (limited to 'src/server.ts')
-rw-r--r--src/server.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/server.ts b/src/server.ts
index cbfebbf..c10b91f 100644
--- a/src/server.ts
+++ b/src/server.ts
@@ -1,15 +1,15 @@
+import https from "https";
import morgan from "morgan";
import express from "express";
+import { resolve } from "path";
import { config } from "dotenv";
-import https from "https";
-import { resolve } from "path";
-import corsConfig from "./config/cors";
-import { ratelimit } from "./config/ratelimit";
-import errorHandler from "./config/errorHandler";
-import notFoundHandler from "./config/notFoundHandler";
+import corsConfig from "./config/cors.js";
+import { ratelimit } from "./config/ratelimit.js";
+import errorHandler from "./config/errorHandler.js";
+import notFoundHandler from "./config/notFoundHandler.js";
-import animeRouter from "./routes";
+import animeRouter from "./routes/index.js";
config();
const app: express.Application = express();
@@ -19,7 +19,7 @@ app.use(morgan("dev"));
app.use(corsConfig);
app.use(ratelimit);
-app.use(express.static(resolve(__dirname, "..", "public")));
+app.use(express.static(resolve("public")));
app.get("/health", (_, res) => res.sendStatus(200));
app.use("/anime", animeRouter);