Tech stack:
- Express (JavaScript + TypeScript)
- MongoDB
- Mongoose as Object Data Modeling library
Launches on port 3000 by default unless instructed otherwise. Skeleton Rest API has two GET endpoints:
/api/districts, returns an array of JSON Features containing shapes for admin borders/api/green-areas, returns an array of JSON Features containing shapes for green areas
docker build -t green-spaces-backend:v1 .The command builds a Docker image with the name green-spaces-backend and tag v1.
Copy the template for the environment variable files:
cp .env.template .envSpecify the environment variables in the .env file. Then run locally the following command:
docker run -p 3000:3000 --env-file=.env green-spaces-backend:v1The image is also available on GitHub Container Registry. You may find it here. Images are created automatically after each push, merge pull request. There are several tags available:
latest— the latest version of the imagesha-<commit_sha>— the image built from the specific commit<branch_name>— the image built from the specific branchpr-<pull_request_number>— the image built from the specific pull request (generates automatically after the pull request is merged)
To pull the image from the GitHub Container Registry, use the following command:
docker pull ghcr.io/annahuskova/green-spaces-backend:<tag>To run the container with the image from the GitHub Container Registry, use the following command:
docker run -p 3000:3000 --env-file=.env ghcr.io/annahuskova/green-spaces-backend:<tag>