update readme

This commit is contained in:
Nicola Zambello 2023-07-07 08:28:25 +02:00
parent 761f47d6b7
commit 4d0f32f640
Signed by: nzambello
GPG key ID: 56E4A92C2C1E50BA

View file

@ -6,17 +6,18 @@ Runs on Node and uses [Hono](https://hono.dev).
Can be adapted to run on Bun, Cloudflare Workers, or any other serverless platform.
Available as a [Docker image](https://hub.docker.com/r/nzambello/redirector).
Repository: [nzambello/redirector](https://git.nzambello.dev/nzambello/redirector).
## Usage
```
```sh
yarn install
REDIRECT_URL=https://nzambello.dev PERMANENT=true yarn start
```
Then, open http://localhost:7878/ in your browser.
```
```sh
open http://localhost:7878
```
@ -29,13 +30,13 @@ It loads configuration from environment variables:
- `REDIRECT_URL`: (**required**) the url to redirect to
- `PERMANENT`: if true, it will return a 301 status code, otherwise 302
## Docker example
### Docker example
```
```sh
docker run -p 7878:7878 -e REDIRECT_URL=https://nzambello.dev -e PERMANENT=true nzambello/redirector:latest
```
## Docker compose example
### Docker compose example
```yaml
version: "3.8"
@ -49,3 +50,11 @@ services:
ports:
- 7878:7878
```
## Development
To update the Docker image:
```sh
docker buildx build --platform linux/amd64,linux/arm64 -t nzambello/redirector:latest --push .
```