"Advanced Node and Express - Set up a Template Engine" passes as correct despite wrong solution
See original GitHub issueDescribe your problem and how to reproduce it: When setting up Pug for the first time, even though I didn’t choose to render the index.pug page, but sent it (using app.sendFile), the FCC checker passed my solution as correct.
Code that wrongly passes tests:
app.route('/')
.get((req, res) => {
res.sendFile(process.cwd() + '/views/pug/index.pug');
});
Actual solution:
app.route('/')
.get((req, res) => {
res.render(process.cwd() + '/views/pug/index.pug');
});
This is especially confusing for a beginner as the boilerplate comes with res.sendFile as a default, simply changing the path results in the behavior shown in the screenshots below.
Add a Link to the page with the problem: https://www.freecodecamp.org/learn/information-security-and-quality-assurance/advanced-node-and-express/set-up-a-template-engine
Tell us about your browser and operating system:
- Browser Name: Firefox
- Browser Version: 74
- Operating System: Linux Mint 19
If possible, add a screenshot here (you can drag and drop, png, jpg, gif, etc. in this box):
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
hi @Sky020 we’ve submitted another pr to relax the regex a bit more. it’s pending review.
I believe the single period (relative path) the way you’ve written it doesn’t work in even the glitch app. It’s pointing at the wrong path. should be … or just /pug
There is still an issue of the test not passing with correct solutions:
OR