1
1
import express , { type Request , type Response } from "express"
2
2
import logger from "morgan"
3
- import { join } from "node:path"
4
-
3
+ import * as path from "node:path"
5
4
import {
6
5
errorHandler ,
7
6
errorNotFoundHandler ,
8
7
} from "./middleware/error.middleware.js"
9
-
10
8
import {
11
9
authenticatedUser ,
12
10
currentSession ,
13
11
} from "./middleware/auth.middleware.js"
12
+
14
13
import { ExpressAuth } from "@auth/express"
15
14
import { authConfig } from "./config/auth.config.js"
16
15
import * as pug from "pug"
17
16
18
17
export const app = express ( )
19
18
20
- app . set ( "port" , process . env . PORT || 3004 )
19
+ app . set ( "port" , process . env . PORT || 3000 )
21
20
22
21
// @ts -expect-error (https://stackoverflow.com/questions/45342307/error-cannot-find-module-pug)
23
22
app . engine ( "pug" , pug . __express )
24
- app . set ( "views" , join ( import . meta. dirname , ".." , "views" ) )
23
+ app . set ( "views" , path . join ( import . meta. dirname , ".." , "views" ) )
25
24
app . set ( "view engine" , "pug" )
26
25
27
26
// Trust Proxy for Proxies (Heroku, Render.com, Docker behind Nginx, etc)
@@ -33,7 +32,7 @@ app.use(logger("dev"))
33
32
// Serve static files
34
33
// NB: Uncomment this out if you want Express to serve static files for you vs. using a
35
34
// hosting provider which does so for you (for example through a CDN).
36
- // app.use(express.static(join(import.meta.dirname, "..", "public")))
35
+ // app.use(express.static(path. join(import.meta.dirname, "..", "public")))
37
36
38
37
// Parse incoming requests data
39
38
app . use ( express . urlencoded ( { extended : true } ) )
0 commit comments