Skip to content

An application which creates short URLs from long ones.

License

Notifications You must be signed in to change notification settings

bsfarnsworth/url-shortener

Repository files navigation

url-shortener

url-shortener is a project to build an application that creates short URLs from long ones.

The repository is reached at https://github.com/bsfarnsworth/url-shortener.

Overview

This document describes the concept and design of wee, a nickname for this application.

Install

  • Create a new directory and clone the project from git: e.g.
git clone ssh://[email protected]/bsfarnsworth/url-shortener .
cd url-shortener
  • Build the executable
bin/build.sh
  • Run it
./wee &
  • Open a browser window to the developer deployment
localhost:3000
  • Or, to the production cloud deployment
https://wee.fly.dev

Usage

  • Open a terminal to the directory where you installed url-shortener
cd tests
  • Choose either the developer (testconfig.cfg) or production (prodconfig.cfg) configuration
source testconfig.cfg

or

source prodconfig.cfg
  • Shorten any URL of your choice. For instance,
./shorten.sh 'https://apod.nasa.gov/apod/'

The JSON weeUrl value is your shortened URL. On my development deploy it came up as xqltu46.

{"token":"79f99aed-2779-4bea-905c-5def4750340e","weeUrl":"xqltu46"}
  • Confirm the URL of a weeURL:
./lengthen.sh xqltu46
  • Retire the URL. You use the token value (from the shorten step:
./retire.sh 79f99aed-2779-4bea-905c-5def4750340e
  • Make use of the wee URL. If we are using the development server,
localhost:3000/to/xqltu46

or the cloud server:

https://wee.fly.dev/to/xqltu46

Your browser should display the URL that you chose to shorten.

Important, the weeURLs are to be used on the same server where they were shortened. This is because the table of URLs lives on the server where it was created and they are not shared between the servers.

Caveats

  1. The web UI is, to put it simply, not very graceful. It offers only the ability to create wee Urls and the display of them scrolls down the screen. But it is really simple to use :)

About

An application which creates short URLs from long ones.

Resources

License

Stars

Watchers

Forks

Packages

No packages published