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 Build a REST API With Express Completing and Testing the API Next Steps

Example project with promises, Express sanitizing middleware, and Mongoose validation

Hey all,

Just wanted to share my completed version of the project. I used ES6 syntax features where possible (and appropriate), including promises, in case anyone was wanting to see an example of how to avoid callback hell. Also, I set up Mongoose validation on the inputs so empty text won't be accepted, and an HTML sanitizer to take care of most XSS attacks.

https://github.com/PortableStick/treehouse_express_api

1 Answer

Iulia Maria Lungu
Iulia Maria Lungu
16,935 Points

Awesome. Loved the ternary operator single-line expressions :)

Here's mine, with an incomplete React Js front-end app (yet incomplete though, I am on it right now).

QA-ReactJS-Express-Mongoose-RestAPI

Very nice!