REST API that implements the three following features:
-
npm
npm install npm@latest -g
-
Docker
Instalation guide: https://docs.docker.com/get-docker/
Note: If you don't to install docker you will need to have mongodb configured locally on your computer.
- Clone the repo
git clone https://github.com/rodrigo-estrela/ze-partners-api.git
- Install NPM packages
npm install
- Run dev script
npm run dev
- Await confirmation message on the console
Server running at http://localhost:<PORT>
- To run all unit tests, execute the following script:
npm run test:unit
- To run all integration tests, execute the following script:
npm run test:integration
- To run ALL tests, execute the following script:
npm run test
- To check tests coverage, execute the following script:
npm run test:ci
Save a partner to the database
Parameters | Comments |
---|---|
tradingName | Required. Partner Trading Name [string] |
ownerName | Required. Partner owner Name [string] |
document | Required. Partner document [string] |
coverageArea | Required. A valid GeoJON MultiPolygon |
address | Required. A valid GeoJON Point |
Returns a partner
Parameters | Comments |
---|---|
partnerId | A valid ObjectId |
Search the nearest partner which the coverage area includes the given location
Parameters | Comments |
---|---|
lon | Required. A valid longitude data [number] |
lat | Required. A valid longitude data [number] |