In the solution to question number 2,
It is written that:
app.use('/public', express.static('/public'))
but this cause an error and the right answer is
- inserting a dot "." before the back-slash "/". As the path that you provide to the express.static function is relative to the directory from where you launch your node process.
- app.use("/public", express.static("./public"))
- OR,
- without the back-slash "/" in the argument to "express.static" function
app.use('/public', express.static('public'))
In the solution to question number 2,
It is written that:
app.use('/public', express.static('/public'))
but this cause an error and the right answer is
app.use('/public', express.static('public'))