1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-02 01:19:31 +00:00

Configured express to use ejs templating language

This commit is contained in:
2022-01-23 23:57:32 +00:00
parent fb419c3692
commit dc881fcfa9
3 changed files with 197 additions and 0 deletions

4
app.js
View File

@@ -25,6 +25,10 @@ async function main() {
// Initialise express app
const app = express();
// Set up templating language and path
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname, '/views/pages'));
// Set up parsers to allow reading of POST form data
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));