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 Refactoring and Modularizing a REST API Structuring Your REST API

get quotes and get a single quote works just fine but when I want to post or edit a post I get 500 internal server error

I get a 500 status error after re-structuring my file and trying send a POST or PUT request on postman

1 Answer

fixed the problem, altho the teacher recommended that we keep app.use(express.json()); in the app.js file but the solution was to insert it in the routes.js file as the following: const router = express.Router(); router.use(express.json());