Skip to content

Commit 3f67bf4

Browse files
committed
#48 bug issue resolved
1 parent 890c40d commit 3f67bf4

File tree

3 files changed

+2
-18
lines changed

3 files changed

+2
-18
lines changed

app.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import express from "express";
2-
import path, { dirname } from "path";
32
import morgan from "morgan";
43
import cookieParser from "cookie-parser";
54
import cors from "cors";
6-
import { fileURLToPath } from "url";
75
import { logger } from "#util";
86
import indexRouter from "#routes/index";
97
import usersRouter from "#routes/users";
108
import authRouter from "#routes/auth";
119

1210
const app = express();
13-
const currDirName = dirname(fileURLToPath(import.meta.url));
1411

1512
app.use(morgan(
1613
":remote-addr - :remote-user \":method :url HTTP/:http-version\" :status \":referrer\" \":user-agent\"",
@@ -21,9 +18,9 @@ app.use(cors());
2118
app.use(express.json());
2219
app.use(express.urlencoded({ extended: false }));
2320
app.use(cookieParser());
24-
app.use(express.static(path.join(currDirName, "public")));
2521

2622
app.use("/", indexRouter);
23+
2724
app.use("/users", usersRouter);
2825
app.use("/auth", authRouter);
2926

controller/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function home(req, res) {
2-
res.render("index", { title: "Express" });
2+
res.render("public/index.html", { title: "Express" });
33
}
44

55
export default { home };

public/index.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)