/martian-robots

Simple Web Service that receives a set of instrcutions/commands to move the robots on Mars.

Primary LanguageJavaScript

martian-robots challenge

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.

Getting set up

  1. Clone the git repository at martian-robots. You can also execute
git clone https://github.com/madjava/martian-robots.git
  1. Nagivate into the repo and execute the following command

    npm i

    It is assumed that Node and npm has be installed on your machine

  2. 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 Application Endpoints

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

Test

To run all test cases

npm test

This would execute all existing tests. Jest was used as the test runner

Instructions

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