This API provides information about Star Wars universe by connecting to the Star Wars API (SWAPI). Built with Node.js and Express.
- Clone the repository:
git clone <repository_url>
- Navigate to the project directory and install dependencies:
cd <project_dir> npm install
- Run the server:
npm start
The API has three endpoints:
-
/api/starships/luke: Returns a list of the Starships related to Luke Skywalker.Usage:
curl http://localhost:3000/api/starships/luke
-
/api/species/episode1: Returns the classification of all species in the 1st episode.Usage:
curl http://localhost:3000/api/species/episode1
-
/api/planets/total_population: Returns the total population of all planets in the Galaxy.Usage:
curl http://localhost:3000/api/planets/total_population
To run the tests:
npm test