You will need Control Tower up and running - either natively or with Docker. Refer to the project's README for information on how to set it up.
The document adapter microservice is built using Node.js, and can be executed either natively or using Docker, each of which has its own set of requirements.
Native execution requires:
Execution using Docker requires:
Start by cloning the repository from github to your execution environment
git clone https://github.com/resource-watch/document-adapter.git && cd document-adapter
After that, follow one of the instructions below:
1 - Set up your environment variables. See dev.env.sample
for a list of variables you should set, which are described in detail in this section of the documentation. Native execution will NOT load the dev.env
file content, so you need to use another way to define those values
2 - Install node dependencies using NPM:
npm install
3 - Start the application server:
npm start
The endpoints provided by this microservice should now be available through Control Tower's URL.
1 - Create and complete your dev.env
file with your configuration. The meaning of the variables is available in this section. You can find an example dev.env.sample
file in the project root.
2 - Execute the following command to run Control tower:
./adapterDoc.sh develop
The endpoints provided by this microservice should now be available through Control Tower's URL.
There are two ways to run the included tests:
Follow the instruction above for setting up the runtime environment for native execution, then run:
npm test
Follow the instruction above for setting up the runtime environment for Docker execution, then run:
./adapterDoc.sh test
- PORT => TCP port in which the service will run
- NODE_PATH => relative path to the source code. Should be
app/src
- CT_REGISTER_MODE => if
auto
the microservice automatically registers on Control Tower on start - CT_TOKEN =>
- API_VERSION => API version identifier that prefixes the URL. Should be
v1
- MONGO_PORT_27017_TCP_ADDR => IP/Address of the MongoDB server
- CT_URL => Control Tower URL
- LOCAL_URL => Local URL
- RABBITMQ_URL => RabbitMQ URL
- ELASTIC_PORT_9200_TCP_ADDR => Elasticsearch URL
You can optionally set other variables, see this file for an extended list.