Follow the instructions below to install and use the project:
- Clone this repository to your local machine:
git clone https://github.com/skay1994/the-space-devs-api the-space-devs-api
- Navigate to the project directory:
cd the-space-devs-api
- Start the server using Docker Compose:
docker-compose up -d
- Access container ssh:
docker exec -it server /bin/sh
- Inside the container, run the following command to install project dependencies using Composer:
composer install
- Run the migrations to create the database tables:
php artisan migrate
- Run the cron command to import data from The Space Devs project:
php artisan the-space-devs:launch-import
- Access the API in your browser or API client:
http://localhost:8080
The following endpoints are available in the REST API:
POST /api/login
: Creates a new user token with email and passwordPOST /api/logout
: Removes a user token currently logged inGET /api/
: Returns a message "REST Back-end Challenge 20210221 Running"PUT /api/launchers/:launchId
: Responsible for receiving updates madeDELETE /api/launchers/:launchId
: Removes a launch from the databaseGET /api/launchers/:launchId
: Retrieves information about a specific launch from the databaseGET /api/launchers
: Lists the launchers from the database in a paginated manner