Version: 1.4, Last updated: 2021-02-02
- PHP >= 7.3
- Composer: https://getcomposer.org/
- SQLITE for the database
- Free local port on 8000
- Browser, e.g Chrome
- API testing tool, e.g. Postman
This application uses Laravel - you can find more information about the framework here:
- Unzip file or clone from github:
git clone https://github.com/jimtaylor123/Mars
- Run composer install:
composer install
- Run set up migrations:
php artisan migrate:fresh --seed
- Run local server:
php artisan serve
- You should now be able to see the running application at http://localhost:8000
- Show all rovers: in your browser visit the url http://localhost:8000/rovers
- View a particular rover: in your brownser visit the url http://localhost:8000/rovers/1
- Create a rover: using postman send a POST request to http://localhost:8000/rover with headers Accept:application/json and raw json body, e.g.
{
"x": 1,
"y": -1,
"direction": "south"
}
- Update (ie. drive) a rover: using postman send a PATCH request to http://localhost:8000/rover/1 with headers Accept:application/json and raw json body, e.g.
{
"commandString": "l bfbff"
}
Run all tests using the following command: `
php artisan test
All tests should pass!