Skip to content

Refactoring changes#1

Open
lacedwithennui wants to merge 6 commits intomainfrom
general-refactor
Open

Refactoring changes#1
lacedwithennui wants to merge 6 commits intomainfrom
general-refactor

Conversation

@lacedwithennui
Copy link
Copy Markdown
Owner

Changes:

Changes to the Codebase:

  • New Response class which contains an HTTP code, headers, and a body and is built with a fluent interface design pattern and can be converted to spark.Response objects
  • All Mongo.java helper methods now return Response objects
  • Somewhat better error handling
    • All server errors caught in try/catch blocks return as error code 500 (except where there is a more descriptive error code, like when a resource is not found on the database)

Changes to the API:

  • All errors now have a consistent response pattern of {"error": "[error message]"}
  • All errors have relatively descriptive error codes
  • All responses are now valid JSON
  • New simple /endpoints API endpoint which returns endpoints and their valid methods
  • Remove redundant /db URI prefix from all endpoints
  • Listen on port 5002 instead of 5003 (for nginx proxy)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant