https://github.com/peterj/color-app
Simple Node.js app with configurable background/foreground color, and a message
https://github.com/peterj/color-app
Last synced: about 1 year ago
JSON representation
Simple Node.js app with configurable background/foreground color, and a message
- Host: GitHub
- URL: https://github.com/peterj/color-app
- Owner: peterj
- License: mit
- Created: 2020-11-21T00:24:00.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-03-01T22:05:35.000Z (over 4 years ago)
- Last Synced: 2025-03-25T15:01:42.653Z (about 1 year ago)
- Language: JavaScript
- Size: 331 KB
- Stars: 3
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Color App 🟥🟨🟩🟦
This app can be used in scenarios where you need multiple website instances that do nothing, but look different. This app displays a web page with a message in the center of the page. The colors (background and foreground) and the message are configurable through environment variables.
## Configuration
| Environment variable name | Description |
| --- | --- |
| `BG_COLOR` | Background color for the website (defaults to ⬛️) |
| `FG_COLOR` | Foreground (text) color (defaults to ⬜️) |
| `MESSAGE` | Message to be displayed (defaults to background color name, if not provided) |
| `VERSION` | App version, returned from `/version` endpoint (defaults to package version, if not provided) |
The colors can be provided as names (`red`, `green`) or as HEX values (`#FF0000`, `#00ff00`).
## Usage
| Command | Rendered Page |
| --- | --- |
| `node app.js` |  |
| `FG_COLOR=blue BG_COLOR=lightgreen node app.js` |  |
| `MESSAGE="Hello world!" FG_COLOR="#f3f4f6" BG_COLOR="#2563eb" node app.js` |  |
### Using Docker image
You can also run the application as a Docker container. You can pull the image from `pj3677/color-app:1.0.0`.
Example usage:
```
docker run --env FG_COLOR="blue" -p 3000:3000 pj3677/color-app:1.0.0
```