From bd92b8b983b567f53403285b013ac0c74ce3c69a Mon Sep 17 00:00:00 2001 From: sabhas Date: Thu, 7 Oct 2021 17:18:51 +0000 Subject: [PATCH] chore: add configuration for static resources and rendering views --- src/app.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index 93db9fe..f6e5df6 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,10 +1,14 @@ import express from 'express' import indexRouter from './routes' - +import path from 'path' const app = express() app.use(express.json({ limit: '50mb' })) +app.set('views', path.join(__dirname, 'views')) +app.set('view engine', 'pug') + +app.use(express.static(path.join(__dirname, '..', 'public'))) app.use('/', indexRouter) export default app