An example API created with v3 of my JSON-API library (http://github.com/ethanresnick/json-api).
- 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/people
to view the people collectionGET http://localhost:3000/people?addNameList
as an example of modifying the library-generated response document (see extra info inmeta
)GET http://localhost:3000/schools
to view all schoolsGET http://localhost:3000/schools/colleges
as an example of constructing a custom query for a request, to show only collegesPOST http://localhost:3000/schools
to add a schoolGET http://localhost:3000/organizations
to view the organizations collection, which includes all schools tooGET http://localhost:3000/people/{id}
to view a person, after it's been createdGET
,POST
, orPATCH
http://localhost:3000/organizations/{id}/relationships/liaisons
to view or modify an organization'sliaisons
relationship