Skip to content

Commit b5a87b5

Browse files
committed
🔄 Synced local '.' with remote 'apps/examples/express'
1 parent 7e8a2a7 commit b5a87b5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

‎src/app.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
import express, { type Request, type Response } from "express"
22
import logger from "morgan"
3-
import { join } from "node:path"
4-
3+
import * as path from "node:path"
54
import {
65
errorHandler,
76
errorNotFoundHandler,
87
} from "./middleware/error.middleware.js"
9-
108
import {
119
authenticatedUser,
1210
currentSession,
1311
} from "./middleware/auth.middleware.js"
12+
1413
import { ExpressAuth } from "@auth/express"
1514
import { authConfig } from "./config/auth.config.js"
1615
import * as pug from "pug"
1716

1817
export const app = express()
1918

20-
app.set("port", process.env.PORT || 3004)
19+
app.set("port", process.env.PORT || 3000)
2120

2221
// @ts-expect-error (https://stackoverflow.com/questions/45342307/error-cannot-find-module-pug)
2322
app.engine("pug", pug.__express)
24-
app.set("views", join(import.meta.dirname, "..", "views"))
23+
app.set("views", path.join(import.meta.dirname, "..", "views"))
2524
app.set("view engine", "pug")
2625

2726
// Trust Proxy for Proxies (Heroku, Render.com, Docker behind Nginx, etc)
@@ -33,7 +32,7 @@ app.use(logger("dev"))
3332
// Serve static files
3433
// NB: Uncomment this out if you want Express to serve static files for you vs. using a
3534
// 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")))
3736

3837
// Parse incoming requests data
3938
app.use(express.urlencoded({ extended: true }))

0 commit comments

Comments
 (0)