diff --git a/README.md b/README.md index 6ab7b14..f58317f 100644 --- a/README.md +++ b/README.md @@ -24,25 +24,47 @@ Dependencies on other Microservices: ## Getting Started -### OS X - **First, make sure that you have the [API gateway running locally](https://github.com/control-tower/control-tower).** -We're using Docker which, luckily for you, means that getting the -application running locally should be fairly painless. First, make sure -that you have [Docker Compose](https://docs.docker.com/compose/install/) -installed on your machine. +Start by cloning the repository from github to your execution environment ``` -git clone https://github.com/resource-watch/query -cd query -./query.sh develop -```text +git clone https://github.com/resource-watch/query.git && cd query +``` + +After that, follow one of the instructions below: + +### Using native execution + +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](#environment-variables) 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 yarn: +``` +yarn +``` + +3 - Start the application server: +``` +yarn start +``` + +The endpoints provided by this microservice should now be available through Control Tower's URL. + +### Using Docker + +1 - Create and complete your `dev.env` file with your configuration. You can find an example `dev.env.sample` file in the project root. -You can now access the microservice through the CT gateway. +2 - Execute the following command to run Control tower: ``` +./query.sh develop +``` + +The endpoints provided by this microservice should now be available through Control Tower's URL. + + +You can now access the microservice through the API gateway. ### Configuration diff --git a/docker-compose-develop.yml b/docker-compose-develop.yml index 737236c..978daee 100644 --- a/docker-compose-develop.yml +++ b/docker-compose-develop.yml @@ -3,12 +3,14 @@ services: develop: build: . ports: - - "35749:35729" + - "5001:5001" environment: + PORT: 5001 + NODE_PATH: app/src CT_URL: http://mymachine:9000 - LOCAL_URL: http://mymachine:5000 + LOCAL_URL: http://mymachine:5001 API_VERSION: v1 - CT_TOKEN: null + CT_TOKEN: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6Im1pY3Jvc2VydmljZSIsImNyZWF0ZWRBdCI6IjIwMTYtMDktMTQifQ.IRCIRm1nfIQTfda_Wb6Pg-341zhV8soAgzw7dd5HxxQ CT_REGISTER_MODE: auto GCLOUD_STORAGE: ${GCLOUD_STORAGE} GOOGLE_APPLICATION_CREDENTIALS: /opt/query/storage.json