Skip to content

codequest-eu/monsters-api

Repository files navigation

Monsters REST API

Fooz Bazz Koo

Welcome to Monsters API - a short list of silly pranksters that loves to mess with code and programmers. Let's meet all of them face to face! 💪

API

By default API works on localhost:8080/api/v1. There's no CORS restrictions 👌. Just make sure your node.js version is >=8.9.4.

$ curl http://localhost:8080/api/v1
{
  "data":{
    "message": "Hello, Monsters API! 👋"
  }
}

$ curl -I http://localhost:8080/api/v1
# ...
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
# ...

End points

  • GET /monsters

Returns array of monsters with their names and slugs. Slug is used for requesting monster details.

{
  "data":[
    {
      "name": "Fooz",
      "slug": "fooz",
      "images": {
        # ...
      }
    },
    {
      "name": "Bazz",
      "slug": "bazz",
      "images": {
        # ...
      }
    },
    # ...
  ]
}
  • GET /monster/:slug

    If slug is correct and monster exists, will response with generated monster details. Each server instance will create new statistics so don't be surprised with the diffs 😉. Those monsters... they're so unpredictable!

{
  "data": {
    "name": "Fooz",
    "statistics": {
      # ...
    },
    "description": "Lorem ipsum...",
    "images": {
      # ...
    }
  }
}

Licence

Monsters images used by the API were dowloaded from http://www.freepik.com. Full terms of usage can be found in licence document.

About

Node.js REST API for recruitment tasks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published