This repository defines a reverse proxy service for the Google Maps Directions API.
It is a service component used by the
which uses this API to perform route selection in the application front-end.
For more information on why this exists, see the
README.md in the
First, clone the repository:
git clone https://github.com/ResidentMario/subway-explorer-gmaps-proxy.git
Install the necessary libraries from the root folder:
.env file in the root folder with your Google Maps Directions API credentials:
Start the service.
It will accessible from
localhost:9000. Here's one URL you can try, to make sure the service is up:
Using the container
This repo contains a Docker file bundled with Node.JS and this application.
To build the container image, run the following from the root folder:
docker build -t residentmario/subway-explorer-gmaps-proxy .
Make sure you have a
.env file populated. Then, to run the container (pointing it to
docker run -p 49161:9000 --env-file .env -d residentmario/subway-explorer-gmaps-proxy
You can visit the following (port-forwarded) URI in the browser to verify that the connection is being served:
You can also jump inside the container by running
docker exec -it 949cc5d81abe /bin/bash (replacing the name with the
name of the running image, discoverable via
docker ps) and inspect the running processes to verify things are running