change some files
This commit is contained in:
@@ -19,7 +19,7 @@ const express = require("express") as typeof import("express");
|
||||
dotenv.config();
|
||||
|
||||
export default class ServerApplication {
|
||||
#PORT = 4000;
|
||||
#PORT = 5000;
|
||||
#APP = express();
|
||||
constructor() {
|
||||
this.serverConfiguration();
|
||||
@@ -47,8 +47,6 @@ export default class ServerApplication {
|
||||
await initDB();
|
||||
// await seedRBAC();
|
||||
|
||||
|
||||
|
||||
this.#APP.listen(this.#PORT, () => {
|
||||
console.log(
|
||||
`Server Running on PORT ${this.#PORT} url : ${"http://localhost:"}${
|
||||
@@ -64,11 +62,12 @@ export default class ServerApplication {
|
||||
// this.#APP.get("/", (req, res) => res.send(""));
|
||||
|
||||
this.#APP.use("/api/v1", mainRouter);
|
||||
|
||||
}
|
||||
ErrorHandlingConfiguration() {
|
||||
this.#APP.use((req: any, res: Response, next: NextFunction) => {
|
||||
next(createHttpError.NotFound("این آدرس یافت نشد"));
|
||||
console.log("dasdadasd");
|
||||
|
||||
next(createHttpError.NotFound("این آدرس یافت نشddد"));
|
||||
});
|
||||
this.#APP.use(
|
||||
async (error: any, req: any, res: ServerResponse, next: NextFunction) => {
|
||||
|
||||
Reference in New Issue
Block a user