Skip to content

sofia32057/project-happy-thoughts-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Happy Thoughts API

This week we're building our own Happy Thoughts API using express.js, mongoose and MongoDB.

The problem

This assignment, too, was pretty straight forward. Following the instructions and looking back on past to weeks made solving this rather painless.

Again, I opted for using "app.route().method()" to group the methods for the respective routes - I just think it looks cleaner.

Switching out the API on the frontend worked!

Added get and delete for single thought by _id.

Next

  • I might add some queries for filtering
  • pagination
  • Stretch goals suggest adding categories, tags and user names
  • I wonder I how can prevent others from using my API and filling up my database... maybe it's next week Authentication?

Requirements

  • Your API should implement the routes exactly as documented in the instructions above (see instructions.md)
  • Your GET /thoughts endpoint should only return 20 results, ordered by createdAt in descending order.
  • Your API should validate user input and return appropriate errors if the input is invalid.
  • In the POST /thoughts endpoint to create a new thought, if the input was invalid and the API is returning errors, it should set the response status to 400 (bad request).
  • The endpoint to add hearts to a thought should return an appropriate error if the thought was not found.

View it live

Happy Thoughts API on Render Happy thoughts front end on Netlify

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%