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 REST APIs with Express Create, Read, Update, Delete Using Try/Catch with Async/Await

Jakub Drobina
Jakub Drobina
12,675 Points

I cant post a req

Every time im sending a req this displays as a response:

<!DOCTYPE html> <html lang="en">

<head> <meta charset="utf-8"> <title>Error</title> </head>

<body> <pre>Cannot POST /quotes</pre> </body>

</html>

i have no idea what im doing wrong

Braydon Coyer
Braydon Coyer
11,164 Points

Are you making sure you have the correct endpoint? If you aren't hitting the right endpoint, I would expect a 404 error, but I don't see that from your response. Maybe posting your code would help us determine the issue.

1 Answer

James Crosslin
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
James Crosslin
Full Stack JavaScript Techdegree Graduate 16,882 Points

I am almost 100% sure I have the answer to this. If you are having this issue, make sure you did not type "app.get" when you should've typed "app.post" in your app.js file.