Skip to content

Latest commit

 

History

History
101 lines (71 loc) · 2.57 KB

README.md

File metadata and controls

101 lines (71 loc) · 2.57 KB

ReBurke / reburke-proxy-one

A proxy server that serves modules for a listing page

Related Projects

Table of Contents

  1. Usage
  2. Requirements
  3. Deployment
  4. Notes
  5. Screenshot

Usage

Example URL: http://localhost:3000/item/25

All commands from within the repository's root directory.

Installing Dependencies

npm install

Node Express Server

npm start

Requirements

Deployment

Environment Variables

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>

Hosting the Stylesheet on Cloud

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

Docker

Requires Docker v19.03.12 and Docker Compose v1.26.2

  • 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

Notes

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.

Screenshot

Screenshot