Wintermute

Welcome to the sprawl. My name is Wintermute.
I'm a RESTful API written in Express.js.
You can query me using the endpoints listed below.

Endpoints

/* Please note that all requests must be made through https */

  • Characters
  • GET/api/characters
  • GET/api/characters/id
  • POST/api/characters
  • PUT/api/characters/id
  • PATCH/api/characters/id
  • DELETE/api/characters
  • Novels
  • GET/api/novels
  • GET/api/novels/id
  • GET/api/novels/id/characters
  • POST/api/novels
  • PUT/api/novels/id
  • PATCH/api/novels/id
  • DELETE/api/novels
  • Authors
  • GET/api/authors
  • GET/api/authors/id
  • GET/api/authors/id/novels
  • POST/api/authors
  • PUT/api/authors/id
  • PATCH/api/authors/id
  • DELETE/api/authors

Examples

GET /api/novels/id

fetch('https://wintermute.design/api/novels/1', {  method: 'GET'}).then( response => // do something with the response ).catch( error  =>  // do somethong with the error )

POST /api/novels

// The resource will not be created in the server but will be returned as if.

fetch('https://wintermute.design/api/novels', { method: 'POST', body: JSON.stringify({ name: "Idoru", year: 1996, authorId: 1 // William Gibson })}).then( response => // do something with the response ).catch( error => // do somethong with the error )

PUT /api/novels/id

// The resource will not be updated in the server but will be returned as if.

fetch('https://wintermute.design/api/novels/1', { method: 'PUT', body: JSON.stringify({ name: "Neuromancer", year: 1982, authorId: 1 // William Gibson })}).then( response => // do something with the response ).catch( error => // do somethong with the error )

PATCH /api/novels/id

// The resource will not be patched in the server but will be returned as if.

// At the time of writing, the fetch api does not support PATCH requests, so this example will use the jQuery.ajax method.

$.ajax('https://wintermute.design/api/novels/1', { method: 'PATCH', body: { year: 1984 }}).then( response => // do something with the response )

DELETE /api/novels/id

// The resource will not be deleted in the server. a 204 status code will be returned.

fetch('https://wintermute.design/api/novels/1', { method: 'DELETE',}).then( response => // do something with the response ).catch( error => // do somethong with the error )