I'm building a shopping cart project using Node, Express, handlebars and MongoDB. Currently, when I attempt to submit a form, using Jquery, I receive a 404 error for my '/checkout' file. Originally, I used return false to prevent the form from submitting before it receives the data. In an attempt to fix the issue, I tried using event.preventDefault, as well. On another forum, someone suggested that my crsf protection is not creating the token properly. I worked with the route and added to my view and finally the hbs form. None of these attempts appear to have solved my issue.
This is a link to my gist. https://gist.github.com/Satellite9/5e4ce3de5c19cee2f355d872b6d7d3c8
This is the error that my browser sends me.
*Error: Not Found at C:\Users\Leimamo\PhpstormProjects\untitled2\app.js:60:13 at Layer.handle [as handle_request] (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:317:13) at C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:275:10) at C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:635:15 at next (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:260:14) at Function.handle (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:174:3) at router (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:47:12) at Layer.handle [as handle_request] (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:317:13) at C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:275:10) at C:\Users\Leimamo\PhpstormProjects\untitled2\app.js:51:5 at Layer.handle [as handle_request] (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:317:13) at C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:275:10) at serveStatic (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\serve-static\index.js:75:16) at Layer.handle [as handle_request] (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\layer.js:95:5) at trim_prefix (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:317:13) at C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:284:7 at Function.process_params (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:335:12) at next (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\express\lib\router\index.js:275:10) at SessionStrategy.strategy.pass (C:\Users\Leimamo\PhpstormProjects\untitled2\node_modules\passport\lib\middleware\authenticate.js:325:9) *
this is the error that npm gives me Post /checkout 404 206.855 ms -5424
Thank you for any insight you may have.
Killeon