jdx / mean-sample

Sample project for Write Modern Web Apps with the MEAN Stack by Jeff Dickey
https://mean-sample.herokuapp.com
165 stars 90 forks source link

Chapter 8 - api sessions 404 #9

Closed hirelee closed 9 years ago

hirelee commented 9 years ago

Hi Dickey, Im almost through your book and have a slight issue with logging in and after using your source code/with a comparison of mine it would appear that there is a 404 error.

Within the book (page 110) we create the controller -> controllers/api/sessions.js, to which the router function is router.post('/' but your source code states router.post('/sessions'. At the moment with your code I'm getting a 404 not found when logging in with the correct details.

Let me know if this is in-fact a bug?

nivaruofficial commented 9 years ago

I receive a 401 status instead... don't know why!

nivaruofficial commented 9 years ago

actually the user data is in the db, i think there is a problem with the token comparing, or with the final destination...further as i'm using the following code: router.get('/', function(req,res){ res.render('app.html'); }); i can't find where or how i can set the folder 'views' for the app.html file.

hirelee commented 9 years ago

@LuigiFrattolillo Im going to re-download the source code for this chapter and re-go-over it tonight and see what is going on.

jdx commented 9 years ago

ah nice find, I'll add a note about this