From 09f3e623a8b419ba327eb53aa321fe6658a4f6c5 Mon Sep 17 00:00:00 2001 From: nzambello Date: Fri, 7 Jul 2023 08:24:11 +0200 Subject: [PATCH] update readme --- README.md | 47 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ea64651..eaaf160 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,45 @@ -``` -npm install -npm run start -``` +# Redirector + +Simple redirection service. +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). + +## Usage ``` -open http://localhost:3000 +yarn install +REDIRECT_URL=https://nzambello.dev PERMANENT=true yarn start +``` + +Then, open http://localhost:7878/ in your browser. + +``` +open http://localhost:7878 +``` + +and you will be redirected to `REDIRECT_URL` from your env. + +## Configuration + +It loads configuration from environment variables: + +- `REDIRECT_URL`: the url to redirect to +- `PERMANENT`: if true, it will return a 301 status code, otherwise 302 + +## Docker compose example + +```yaml +version: "3.8" + +services: + redirector: + image: nzambello/redirector:latest + environment: + - REDIRECT_URL=https://nzambello.dev + - PERMANENT=true + ports: + - 7878:7878 ```