File tree Expand file tree Collapse file tree 3 files changed +2
-18
lines changed Expand file tree Collapse file tree 3 files changed +2
-18
lines changed Original file line number Diff line number Diff line change 11import express from "express" ;
2- import path , { dirname } from "path" ;
32import morgan from "morgan" ;
43import cookieParser from "cookie-parser" ;
54import cors from "cors" ;
6- import { fileURLToPath } from "url" ;
75import { logger } from "#util" ;
86import indexRouter from "#routes/index" ;
97import usersRouter from "#routes/users" ;
108import authRouter from "#routes/auth" ;
119
1210const app = express ( ) ;
13- const currDirName = dirname ( fileURLToPath ( import . meta. url ) ) ;
1411
1512app . use ( morgan (
1613 ":remote-addr - :remote-user \":method :url HTTP/:http-version\" :status \":referrer\" \":user-agent\"" ,
@@ -21,9 +18,9 @@ app.use(cors());
2118app . use ( express . json ( ) ) ;
2219app . use ( express . urlencoded ( { extended : false } ) ) ;
2320app . use ( cookieParser ( ) ) ;
24- app . use ( express . static ( path . join ( currDirName , "public" ) ) ) ;
2521
2622app . use ( "/" , indexRouter ) ;
23+
2724app . use ( "/users" , usersRouter ) ;
2825app . use ( "/auth" , authRouter ) ;
2926
Original file line number Diff line number Diff line change 11function home ( req , res ) {
2- res . render ( "index" , { title : "Express" } ) ;
2+ res . render ( "public/ index.html " , { title : "Express" } ) ;
33}
44
55export default { home } ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments