json-api-example
json-api-example copied to clipboard
An example API created with my JSON-API library (http://github.com/ethanresnick/json-api)
json-api-example
An example API created with v3 of my JSON-API library (http://github.com/ethanresnick/json-api).
Try it out
- Clone the repo
- Run
npm install - Ensure MongoDB is running and listening on the default port
- Run
npm run start - Try out the following (for example):
GET http://localhost:3000/to view the auto-generated documentationGET http://localhost:3000/peopleto view the people collectionGET http://localhost:3000/people?addNameListas an example of modifying the library-generated response document (see extra info inmeta)GET http://localhost:3000/schoolsto view all schoolsGET http://localhost:3000/schools/collegesas an example of constructing a custom query for a request, to show only collegesPOST http://localhost:3000/schoolsto add a schoolGET http://localhost:3000/organizationsto view the organizations collection, which includes all schools tooGET http://localhost:3000/people/{id}to view a person, after it's been createdGET,POST, orPATCHhttp://localhost:3000/organizations/{id}/relationships/liaisonsto view or modify an organization'sliaisonsrelationship