Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript User Authentication With Express and Mongo What is Authentication? Review: Node, Express and npm

Adam Beer
Adam Beer
11,314 Points

Bummer! Unfortunately, that answer is incorrect.

Please help me. This is the question -> Complete the code below so that Express serves static files (like CSS and images) from the public folder located in our applications root folder: // serve static files from /public //// app.use(express.static(dirname + '')); I tried app.use(express.static(__dirname + '/public')); but it doesn't working. Anybody know why it doesn't?

Neil McPartlin
Neil McPartlin
14,662 Points

Hi Adam. I did this course just a few months back and I don't recall this question being a problem. I agree with you that this should be the answer...

app.use(express.static(__dirname + '/public')); 

...and right now, it fails the test.

If you visit the Express docs here...

https://expressjs.com/en/4x/api.html#express.static

...and in your browser search (CTRL + F) for dirname, the first match out of 12 is the solution that is failing.

I suggest you contact Treehouse support directly about this. I note there is a 'Report Question' option (below and to the right of the 'Submit Answer' button) which I've never used, or email them directly at help@teamtreehouse.com.

Adam Beer
Adam Beer
11,314 Points

Hi Neil! I've been writing to them twice but nothing happens. No response. Thanks for the help. Have a nice day!

Neil McPartlin
Neil McPartlin
14,662 Points

You're welcome. I have written to them too. Let's see what happens.

2 Answers

James Churchill
STAFF
James Churchill
Treehouse Teacher

Adam and Neil,

Sorry for the bug in this quiz question! And thanks for taking the time to report the issue to us.

I'm happy to report that the broken quiz question has been fixed.

Thanks ~James

Neil McPartlin
Neil McPartlin
14,662 Points

Yep. All good now. Thanks James.

Adam Beer
Adam Beer
11,314 Points

Thanks James and Neil!