The martian-robots
challenge has been implemented as a REST service that recieves instructions from a client and executes those instructions to move the robots to requested location.
- Clone the git repository at martian-robots. You can also execute
git clone https://github.com/madjava/martian-robots.git
-
Nagivate into the repo and execute the following command
npm i
It is assumed that Node and npm has be installed on your machine
-
To start the service run the command:
npm start
Service should start on the default port which is set to
3000
. If you prefare to use another port then specify your desired port like so:PORT=<your port> npm start
The service has two endpoints only
GET: /
Will return some basic instructions on the expected payload
POST: /basestation
Will expect a payload with commands for the robots, what orientation to take and how many points to move
Any other route would return a 404
To run all test cases
npm test
This would execute all existing tests. Jest was used as the test runner
After the service is up and running, navigate to /
path for futher information e.g http://localhost:3000
or whatever port you may have specified