loama / Naruto-API

NodeJS API that connects to the Naruto wikia, fetches characters and gives them back in a handy JSON format

Home Page:https://naruto-api-prod.herokuapp.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Naruto API

Here lives the core of the Naruto API which constantly fetches info from the Naruto wikia page, saves them to a Postgres DB and allows access to the info in a handy JSON format.

ROUTES

All characters: http://naruto-api-prod.herokuapp.com/v1/characters Specific one: http://naruto-api-prod.herokuapp.com/v1/characters/:title e.g: http://naruto-api-prod.herokuapp.com/v1/characters/Abiru

Architecture

NodeJS for API endpoints NodeJS for worker function to update the data automatically Postgres DB to save the data Heroku to host everything

Features

  • Versioned

  • <1s response time in any endpoint

  • Continuous Integration with Travis

  • GitFlow

Future Features

  • Logs of every event πŸ”œ

  • TDD

  • Micro service architecture πŸ”œ

  • Continuous Testing πŸ”œ

  • Events websocket stream πŸ”œ

HTTP Codes

This are the diferent HTTP response codes which we might use for a given response.

Code Meaning  Detail
200 OK
201 Created
400 Bad Request wrongly formatted request
401 Unauthorized missing or bad authentication
403 Forbidden the user is authenticated but isn’t authorized to perform the requested operation on the given resource.
404 Not Found incorrect path

## Endpoints

method url name detail status
GENERAL
GET / general index useful to check that you are correctly connecting to the API (url, authentication, etc) βœ…
GET /v1 v1 index useful to check that you are correctly connecting to the API V1 (url, authentication, etc) πŸ”œ

Development

Run locally

  • clone this repo to your local machine
  • npm install to install all dependencies
  • npm run develop
  • open localhost:8888 on your web browser or start making request to this url with postman

This will run with nodeman, which will be watching for changes in files to reload them on save.

Devops

The app runs on heroku, master branch runs on production, development runs on qa.

Contributing

We use GitFlow Just open your feature branch and when your changes are ready, open a Pull Request to the develop branch.

Please open issues for bugs, to request features or to ask about the implementation.

About

NodeJS API that connects to the Naruto wikia, fetches characters and gives them back in a handy JSON format

https://naruto-api-prod.herokuapp.com/


Languages

Language:JavaScript 100.0%