https://github.com/codesignal/learn_preview-proxy
A proxy we can use to control the preview in CodeSignal Learn
https://github.com/codesignal/learn_preview-proxy
Last synced: 8 months ago
JSON representation
A proxy we can use to control the preview in CodeSignal Learn
- Host: GitHub
- URL: https://github.com/codesignal/learn_preview-proxy
- Owner: CodeSignal
- License: other
- Created: 2025-02-11T21:22:45.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-02-11T21:33:51.000Z (10 months ago)
- Last Synced: 2025-02-11T22:29:37.488Z (10 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Preview Proxy
A simple proxy server that shows a loading page until the target application is ready.

## Features
- Shows a customizable loading page until the target application signals readiness
- Proxies all requests to a target port once ready
- Configurable redirect path when application is ready
- Customizable loading screen messages
## Usage
```bash
npm install
node proxy.js [options]
```
### Options
- `--server-port `: Set the port for the proxy server (default: 3000)
- `--proxy-port `: Set the port for the target application (default: 3001)
- `--redirect-path `: Set the path to redirect to when the application is ready (default: "/")
- `--heading-message `: Set the heading text for the loading page (default: "Loading Application")
- `--subheading-message `: Set the subheading text for the loading page (default: "Please wait while we initialize your session...")
- `is-ready`: Start in the ready state and skip the loading page
### Installing Node.js
Some environments require installing Node.js manually. Use the `install_node.sh` script to install the correct version of Node.js for this project. It will start by installing `nvm` and then installs Node.js.
### A common scenario:
To use this proxy, simply clone the repo, install Node.js if necessary, and start the proxy.
```bash
git clone --depth 1 --branch v0.0.1 https://github.com/codesignal/learn_preview-proxy.git > /dev/null 2>&1
cd learn_preview-proxy
bash ./install_node.sh
source ~/.bashrc
node proxy.js
```