A proxy server that serves modules for a listing page
- https://github.com/HRR47-SDC-OMalley/sidebar-service
- https://github.com/HRR47-SDC-OMalley/main-photo
- https://github.com/HRR47-SDC-OMalley/Reviews-Service
Example URL: http://localhost:3000/item/25
All commands from within the repository's root directory.
npm install
npm start
- Node.js v12.18.1
If you use Docker Compose, it will add them from your .env file.
If you run the server with $
npm start
, the environment variables are required to be set up in the shell.
Please refer to the default variables in server/index.js for examples.
- PORT=<your-server-port>
- URL=<your-origin-url>
- PHOTO_TARGET=<main-photo-service-url>
- PHOTO_SCRIPT=<main-photo-script-url>
- SB_TARGET=<sidebar-service-url>
- SB_SCRIPT=<sidebar-script-url>
- REVIEWS_TARGET=<seller-reviews-service-url>
- REVIEWS_SCRIPT=<seller-reviews-script-url>
- SLN_TARGET=<similar-listings-and-news-service-url>
- SLN_SCRIPT=<similar-listings-and-news-script-url>
Requires the dev dependencies to be installed
-
Create the grunt-aws.json file at $HOME/.aws directory
{ "accessKeyId": "<your-access-keyId>", "secretAccessKey": "<your-access-secret>", "bucket": "<your-bucket-name>", "path": "<optional-path>/" || "" }
-
Add
CLOUD_STYLE_URL=<your-bucket-url[-path]>
to the environment variables -
Run $
grunt
on the terminal
-
Create an .env file in the repository's main folder
-
Add the environment variables and save the file
-
Run $
docker-compose up -d
to start running the service on port 80
If the security group settings and ports are not properly set up for your proxy server or one of the services, you may receive a 504 Gateway Timeout or an ECONNREFUSED error in your proxy. You may follow the instructions in this file to use redirection instead of proxy in your server/index.js.