Skip to content

Instantly share code, notes, and snippets.

@ppizarro
ppizarro / pragmatic-rest.md
Last active July 8, 2023 10:23
Pragmatic REST

Pragmatic REST

  • Nouns are good; verbs are bad
  • Keep your base URL simple and intuitive
  • Only 2 base URLs per resource
  • For a collection
/dogs
@fwielstra
fwielstra / api.js
Created June 14, 2011 14:46
An example NodeJS / Mongoose / Express application based on their respective tutorials
/* The API controller
Exports 3 methods:
* post - Creates a new thread
* list - Returns a list of threads
* show - Displays a thread and its posts
*/
var Thread = require('../models/thread.js');
var Post = require('../models/post.js');