This repository contains a RESTful API for a Pokedex that allows users to search for information about different Pokemon. The API is built using Node.js and Express, and data about the Pokemon is stored in JSON files.
The API has the following endpoints:
GET /:pokemon
: returns information about the specified Pokemon.GET /start/search
: starts an interval that searches for a random Pokemon every second.GET /stop/search
: stops the interval started by/start/search
.GET /validate/pokemon
: returns information about a random Pokemon if it is present in a pre-defined list.GET /notfound
: returns a 404 error.GET /notavailable
: returns a 502 error.
To use the API, you need to have Node.js and npm installed.
- Clone the repository:
$ git clone https://github.com/siorellana/pokedex-api.git
- Install the dependencies:
$ cd pokedex-api
$ npm install
- Start the server
$ npm start
The server should be listening at http://localhost:3000.
This repository includes some basic tests. To run them, you need to have jest and supertest installed.
- Install the development dependencies:
$ npm install --only=dev
- Run the tests:
$ npm test
This API is also available as a Docker image. To run it in a container, you need to have Docker installed.
- Pull the image from Docker Hub:
$ docker pull siorellana/pokedex-api
- Run a container with the image:
$ docker run -p 3000:3000 siorellana/pokedex-api
This project is licensed under the MIT License.
- @ChatGPT - OpenAI-trained conversational AI model
This project is not affiliated with, endorsed, sponsored, or specifically approved by The Pokémon Company or its affiliates. Pokémon is a registered trademark of The Pokémon Company.