- Built using the Serverless framework
- Deployed into AWS Lambda
- Surfaced via the AWS API Gateway
This API is for management of Mars Rovers.
Methods | Endpoint | Summary |
---|---|---|
POST | /calculate-position | Calculate position of Mars Rovers |
This endpoint calculates the position of Mars Rovers. It returns a list of coordinates and the cardinal orientation.
// Example request:
{
"plateau": {
"gridSize": "5 5"
},
"rovers": [
{
"position": "1 2 N",
"instructions": "LMLMLMLMM"
},
{
"position": "3 3 E",
"instructions": "MMRMMRMRRM"
}
]
}
// Example response:
{
"id": "67531bd0-5bcb-11ea-87f2-1f6031af5bc7",
"rovers": [
{
"roverId": "67531bd1-5bcb-11ea-87f2-1f6031af5bc7",
"position": "1 3 N"
},
{
"roverId": "675342e0-5bcb-11ea-87f2-1f6031af5bc7",
"position": "5 1 E"
}
]
}
npm install
Navigate into the root of the project and run 'npm install' to install all dependencies
npm run dev
Then run 'npm run dev' which will deploy the endpoint on your localhost on port 3000. You will now be able to test the API on http://localhost:3000
npm run test
The 'npm run test' command will run all unit tests within the spec/unit folder showing which tests passed or failed. This command will not display the coverage percentage