Advanced Node and Express Challenges failing tests
See original GitHub issueDescribe your problem and - if possible - how to reproduce it
The advanced Node and Express challenges are failing even with correct code. (Pug is a dependency as well in my project.)
'use strict';
const express = require('express');
const bodyParser = require('body-parser');
const fccTesting = require('./freeCodeCamp/fcctesting.js');
const app = express();
fccTesting(app); //For FCC testing purposes
app.use('/public', express.static(process.cwd() + '/public'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
app.set('view engine', 'pug');
app.route('/')
.get((req, res) => {
// res.sendFile(process.cwd() + '/views/index.html');
res.render(process.cwd() + '/views/pug/index.pug', {title: 'Hello', message: 'Please login'});
});
app.listen(process.env.PORT || 3000, () => {
console.log("Listening on port " + process.env.PORT);
});
Add a Link to the page with the problem
Tell us about your browser and operating system
- Browser Name: Google Chrome
- Browser Version: Version 67.0.3396.87 (Official Build) (64-bit)
- Operating System: OSX Yosemite Version 10.10.3
If possible, add a screenshot here
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Advanced Node and Express - ensureAuthenticated always ...
I've been passing all the tests, but the app is clearly not working. ... Advanced Node and Express - ensureAuthenticated always failing.
Read more >Advanced Node and Express | FreeCodeCamp - YouTube
I go though the Advance Node and Express challenges on FreeCodeCamp. Most of these challenges are just copy and paste, so they weren't...
Read more >Top Node.js Interview Questions and Answers in 2023 - Edureka
This blog lists the top Node.js interview questions you might be asked in Nodejs job interviews in 2023 on concepts such as Node.js...
Read more >Performance Best Practices Using Express in Production
Node applications crash if they encounter an uncaught exception. The foremost thing you need to do is to ensure your app is well-tested...
Read more >VSTest@2 - Visual Studio Test v2 task - Microsoft Learn
Collect process dump and attach to test run report. Default: onAbortOnly. #rerunFailedTests: False # boolean. Rerun failed tests. Default: False ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@a-nuen I’ve solved this issue. You should put somewhere on the page string ‘Home page’, for example on the h1, also for profile page you should add the string ‘Profile’. You can check tests source code on the link https://github.com/freeCodeCamp/curriculum/blob/dev/challenges/06-information-security-and-quality-assurance/advanced-express-tools.json
For those who are continuing to fail the tests despite what has been printed here, I found a solution that worked for me!
You need to add the following code at the top of your server.js file:
This should work for at least some of the tests 😃