Skip to content

Instantly share code, notes, and snippets.

@cs-fedy
Created October 8, 2021 08:42
Show Gist options
  • Save cs-fedy/69f30770123b80be6b20b5e2b0401eda to your computer and use it in GitHub Desktop.
Save cs-fedy/69f30770123b80be6b20b5e2b0401eda to your computer and use it in GitHub Desktop.
module.exports = {
OK: 200, // Everything went fine. I return the resource you requested.
CREATED: 201, // Voilá. We successfully created a new resource for you.
NO_CONTENT: 204, // There is nothing to see here. Useful if you just deleted an object successfully.
UNAUTHORIZED: 401, // You did not provide valid credentials.
NOT_FOUND: 404, // Return this if a requested object could not be found.
UNPORCESSABLE_ENTITY: 422, // Resource cannot be saved. Maybe a validation error?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment