diff --git a/src/server.ts b/src/server.ts index fe723bc..1b7e8e8 100644 --- a/src/server.ts +++ b/src/server.ts @@ -5,10 +5,13 @@ import express, { ErrorRequestHandler, Application, } from "express"; + import { config } from "dotenv"; import morgan from "morgan"; import createHttpError from "http-errors"; +import animeRouter from "./routes"; + config(); const app: Application = express(); const PORT: number = Number(process.env.PORT) || 4000; @@ -16,8 +19,20 @@ const PORT: number = Number(process.env.PORT) || 4000; app.use(morgan("dev")); app.get("/", (req: Request, res: Response) => { - res.json("hi there"); + res.send(` + +

Welcome to Zoro.to api ⚔️

+ + Visit docs for more into + + + `); }); +app.use("/anime", animeRouter); app.use((req: Request, res: Response, next: NextFunction) => next(createHttpError.NotFound()) @@ -33,5 +48,5 @@ const errorHandler: ErrorRequestHandler = (error, req, res, next) => { app.use(errorHandler); app.listen(PORT, () => { - console.log(`⚔ api @ http://localhost:${PORT}`); + console.log(`⚔️ api @ http://localhost:${PORT}`); });