bitreich-short

fork of git.z3bra.org/bitreich-short
git clone git://git.pyratebeard.net/bitreich-short.git
Log | Files | Refs | README | LICENSE

commit 7b8331c5839aff13f698489f54a06b61be506b5c
parent 8b89e4cff4d264ea216968e16180dbb31195f679
Author: Willy Goiffon <dev@z3bra.org>
Date:   Thu, 15 Oct 2020 16:12:21 +0200

Update README to explain URL shortening service

Diffstat:
MREADME.md | 29+++++++++++++++++++----------
1 file changed, 19 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md @@ -1,9 +1,12 @@ -# Bitreich HTTPD +# URL Shortner -Bitreich is serving the technically inferior HTTP protocol. +Shorten URL sent as PUT requests, and generate redirection for shorten +URLs. This service is based on the Bitreich HTTPD inet daemon [0]. This simple service is meant to be used with inetd(8) or xinetd(8). +[0]: gopher://bitreich.org/1/scm/bitreich-httpd + ## Installation % make @@ -13,16 +16,22 @@ This simple service is meant to be used with inetd(8) or xinetd(8). ## Configuration -Edit the bitreich-httpd.c variable »wwwbase« to your root base. Then -change wwwindex to whatever is your index file. In case you need to -serve some other files, see how bitreich.sh is handled. This can be -easily extended. Do not forget to change the Host in printheaders(). +Edit bitreich-httpd.c macro WWWBASE to the short links location. You +can optionally change CHARSET and NAMELEN to change how the shortened +URL would look like. + +Don't forget to update variable `host` to match you server hostname. +"localhost" is fine if you don't intend to share those URLs. -## Bugs +## Usage -Send Bugs to +URL to be shortened must be sent as PUT requests: - Christoph Lohmann <20h@r-36.net> + $ curl -X PUT -d "https://z3bra.org/slj" http://localhost + http://localhost/txw -Have fun! +The shortened URL can then be accessed with a simple GET request. Note +that the server will return the HTTP code 307 (Moved Temporarily), +so your client must be able to follow redirection. + $ curl -L http://localhost/txw