Mars-Rover written in Node NodeJS
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
You'll need Docker installed
A step by step series of examples that tell you how to get a development env running An ENV file containing : INFRASTRUCTURE_WEBSERVER_PORT - I suggest using port 5000 is required.
Orchestrate the dev env
docker-compose up --build
That's it! The webserver is listening on http://localhost:5000
Body of the request should contain the variables below. I suggest you use tools such as postman to run manual commands for this api.
Endpoint : http://localhost:5000/rovers/x/y
Change the x and y to set your gridSize.
Example Body Request:
[{ "roverNo": "1",
"xGrid": 1,
"yGrid":2,
"direction":"N",
"movements":"LMLMLMLMM"
},{ "roverNo": "2",
"xGrid": 3,
"yGrid":3,
"direction":"E",
"movements":"MMRMMRMRRM"
},{ "roverNo": "3",
"xGrid": 1,
"yGrid":2,
"direction":"N",
"movements":"LMLMLMLMM"
}]
Testing is done using Jest
This code currently has 100% code coverage so all functions are tested.
Run the tests with:
npm test
To run the tests in watch mode:
npm test -- --watch
This repo currently uses GitHub actions to run continous integration and also uses github actions for continous deployment. It continously deploys into google cloud and uses kubernetes to host it. It uses kustomize to put all the yaml into one file.
Mars-Rover uses:
to ensure code style cohesion throughout the project.
Git Hooks are triggered by Husky and lint-staged on:
precommit: will try to automatically fix any eslint errors, run the tests for staged files and will re-stage all the fixed/tested files
prepush: will run the tests before pushing
- Ollie Batchelor - Initial work - olliebatch
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details