I am trying to build a node.js following the heroku tutorial. I currently have this:
const express = require('express')
const path = require('path')
const PORT = process.env.PORT || 5000
express()
.use(express.static(path.join(__dirname, 'public')))
.set('views', path.join(__dirname, 'views'))
.set('view engine', 'ejs')
.get('/game', (req, res) => res.render('pages/game/game'))
**.get('/game/firstGame', (req, res) => res.render('pages/game/game-firstGame'))**
.listen(PORT, () => console.log(`Listening on ${ PORT }`))
However, this does not work because everytime I access this page with the window location directed to
https://.../game/firstGame
The heroku app will give me: Internal Server Error
Plus, the Firefox browser tells that I lack the file firstGame although I specified to render the file game-firstGame file
Go to Source
Author: Emma Wang