Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with directory location in the server.js file in the Book Library app #716

Open
n8finch opened this issue Jun 28, 2016 · 2 comments
Open

Comments

@n8finch
Copy link

n8finch commented Jun 28, 2016

Hello Addy.

This is my first issue on GitHub, I hope I'm doing this right, but let me know if I need to make a pull request for this. I would be happy to. Thank you for the Backbone Application book. It's been great to work through so far, and I appreciate your thorough explanations.

Ok, when I typed out your code for the server.js file in my application, I got an error in the window: Cannot GET / . Also in the dev tools, http://localhost:4711/ returns a 404 Not Found.

I think the issue is with the line of code in server.js:
app.use( express.static( path.join( application_root,'../', 'site') ) );

This moves the reference out of the root folder, as I understand it. When I took out the two .., the app displays fine, so now, my line of code looks like:
app.use( express.static( path.join( application_root,'/', 'site') ) );

This is assuming that the server.js file is running in the root at the same level as the node_modules and site directories, which is what I understood from your directions.

I think I'm supposed to submit a PR for this, which will also be my first. Please let me know if I'm getting this right, or what you would like me to do from here.

Again, thanks!
Nate

@kylehalleman
Copy link

I was running into this same issue too and your fix worked for me. I'd recommend submitting a PR since it is such a simple fix, it shouldn't be an issue merging it. Then again I'm not the repo owner so maybe Addy would prefer just making the change himself.

Thanks for the fix though.

@n8finch
Copy link
Author

n8finch commented Jul 6, 2016

Hey Kyle, thanks for the message. I'll probably go ahead and submit the PR. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants