Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/resource-watch/download-dataset
https://github.com/resource-watch/download-dataset
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/resource-watch/download-dataset
- Owner: resource-watch
- License: mit
- Created: 2016-08-29T15:22:05.000Z (about 8 years ago)
- Default Branch: develop
- Last Pushed: 2017-03-09T12:48:32.000Z (over 7 years ago)
- Last Synced: 2024-04-09T11:25:03.062Z (7 months ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Download Dataset API
This repository is the microservice that it implement the download query funcionality and exposed the /download endpoint in the api-gateway
## First time user
Perform the following steps:
* [Install docker](https://docs.docker.com/engine/installation/)
* Clone this repository: ```git clone [email protected]:resource-watch/download-dataset.git```
* Enter in the directory (cd download-dataset-api)
* After, you open a terminal (if you have mac or windows, open a terminal with the 'Docker Quickstart Terminal') and execute the next command:```bash
docker-compose -f docker-compose-develop.yml build```
## Run in develop mode (Watch mode)
Remember: In windows and Mac, open the terminal with 'Docker Quickstart Terminal'```bash
docker-compose -f docker-compose-develop.yml build
//this command up the machine. If you want up in background mode, you add the -d option
```## Execute test
Remember: In windows and Mac, open the terminal with 'Docker Quickstart Terminal'
```
docker-compose -f docker-compose-test.yml run test
```## Install in heroku
Is necessary define the next environment variables:
* API_GATEWAY_URI => Url the register of the API Gateway. Remember: If the authentication is active in API Gateway, add the username and password in the url
* NODE_ENV => Environment (prod, staging, dev)Is necessary the pem file of Google Earth Engine authentication in the root of the project
# Config
## register.json
This file contain the configuration about the endpoints that public the microservice. This json will send to the apigateway. it can contain variables:
* #(service.id) => Id of the service setted in the config file by environment
* #(service.name) => Name of the service setted in the config file by environment
* #(service.uri) => Base uri of the service setted in the config file by environmentExample:
````
{
"id": "#(service.id)",
"name": "#(service.name)",
"urls": [{
"url": "/story",
"method": "POST",
"endpoints": [{
"method": "POST",
"baseUrl": "#(service.uri)",
"path": "/api/v1/story",
"data": ["loggedUser"]
}]
}, {
"url": "/story/:id",
"method": "GET",
"endpoints": [{
"method": "GET",
"baseUrl": "#(service.uri)",
"path": "/api/v1/story/:id"
}]
}, {
"url": "/user",
"method": "GET",
"endpoints": [{
"method": "GET",
"baseUrl": "#(service.uri)",
"path": "/api/v1/story"
}]
}]
}```