The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

hettlage (136) [Avatar] Offline
#1
The use of __dirname inListing 11.5 suggests that __dirname is (as stated in the text) equal to the application folder. However, according to https://nodejs.org/docs/latest/api/modules.html#modules_dirname, it is equal to current module folder.
TheWexler (62) [Avatar] Offline
#2
Sorry if I made that confusing. You're right! I'll clarify that section and offer more insight to the same documentation you provided. Thanks!
hettlage (136) [Avatar] Offline
#3
Thanks! - On a related note, you might make the section(s) on static files a bit clearer if you stressed that setting the directory with express.static does not affect sendFile, and if you pointed out how to use path.resolve when using setFile in a controller.