Skip to content

HereBeAndre/true-layer-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

true-layer-server

A Node.js server that works as backend service for true-layer-client. It communicates with PokéAPI and Fun Translations API in order to provide data to the client.

General Information

This project was bootstrapped with Express application generator.

Table of Contents

Getting started

Pre-requisites

Installation

  • Clone the repository via SSH
git clone git@github.com:HereBeAndre/true-layer-server.git
  • Or clone it via HTTPS
git clone https://github.com/HereBeAndre/true-layer-server.git
  • Install dependencies
cd true-client-server
npm install

The complete list of dependencies is included in ./package-lock.json.

  • Run the project
npm start

The server listens on port 8080.

Available Scripts

In the project directory, you can run:

Npm Script Description
npm start Runs the app in the development mode via node command.
Open http://localhost:8080 to view it in the browser.
npm run dev Runs the app in the development mode via nodemon tool.
nodemon automatically restarts the node application on files changes.
npm run test Runs tests using Jest and SuperTest.

Testing

The tests are written in Jest and the HTTP assertions done using SuperTest.
Test files are created under tests folder.

Production Build

Deploying to production

Architecture

Architecture  

APIs

Note: Fun Translations API ratelimits the number of public API calls to 60 API calls a day with distribution of 5 calls an hour.
When that limit is exceeded, true-layer-client will receive the original Pokémon description provided by PokéAPI.

Requirements

  • Retrieve Shakespearean description;

Usage example:

GET http://localhost:8080/pokemon/charmander

Output:

{
  "name": "mewtwo",
  "description": "'t usually remains motionless to con­ serveth energy, so yond 't may un­ leash its full power in hurlyburly."
}

Room for Improvement

Todo:

  • Dockerize the app;
  • Implement environment variables management for production, development and testing envs;
  • Improve test coverage;
  • RegExp to clean Pokémon description might need a review (/n, /f, etc...)

Known bugs:

  • Some Pokémon descriptions returned by Fun Translation API have a leading '/';

License

This project is licensed under the terms of the MIT license.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published