https://github.com/madjava/martian-robots
Simple Web Service that receives a set of instrcutions/commands to move the robots on Mars.
https://github.com/madjava/martian-robots
Last synced: over 1 year ago
JSON representation
Simple Web Service that receives a set of instrcutions/commands to move the robots on Mars.
- Host: GitHub
- URL: https://github.com/madjava/martian-robots
- Owner: madjava
- Created: 2019-12-18T10:07:41.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-24T00:59:04.000Z (over 3 years ago)
- Last Synced: 2025-01-11T22:44:58.643Z (over 1 year ago)
- Language: JavaScript
- Size: 1.05 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://github.com/madjava/martian-robots.git). You can also execute
```bash
git clone https://github.com/madjava/martian-robots.git
```
2. Nagivate into the repo and execute the following command
```bash
npm i
```
It is assumed that [Node](https://nodejs.org/en/download/) and [npm](https://www.npmjs.com) has be installed on your machine
3. To start the service run the command:
```bash
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:
```bash
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
```bash
npm test
```
This would execute all existing tests. [Jest](https://jestjs.io/en/) 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