url-shortener

command module
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2024 License: MIT Imports: 19 Imported by: 0

README

url-shortener

v0.0.4 : 27 June 2024 : bugfix -- drain httpclient connections

Resolve short urls and redirect them

This web service uses a csv file to provide short urls which redirect to remote urls. The server deals gracefully with calls to / and 404 errors with easily customizable web pages in templates and assets in the static directory.

Try it out on GCP

The example csv file can be found here.

In development mode live reloading of the (minimal) web templates is supported, and the remote urls are checked on startup.

In production mode the assets, including the csv file, are embedded into the Go binary. A Dockerfile is included for easy deployment.

Usage:
  url-shortener 

A web server for redirecting short urls.

This uses a simple csv file of short,long urls as a database.

Run with the -d/-development flag to run in development mode, providing
live template reloads. In development mode, the urls are also checked at
startup.

Application Options:
  -i, --ipaddress=   ipaddress (default: 0.0.0.0)
  -p, --port=        port (default: 8000)
  -d, --development  run in development mode
  -t, --timeout=     development url checker timeout (default: 5s)
  -w, --workers=     development url checker workers (default: 8)

Help Options:
  -h, --help         Show this help message

Screenshot of the home page:

Licence

Licensed under the MIT Licence.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL