/Oblique

Oblique is a URL shortening service written in NodeJS and Javascript to make calls to an API endpoint, includes both Frontend & the backend + Bash/Python scripts.

Primary LanguageCSSGNU General Public License v3.0GPL-3.0

Oblique

URL Shortener that makes use of LowDB to store & search for saved URLs.

Frontend

  • Copy function, let's try DOM way but ClipboardJS is the last resort.
    • Add Copy button next to the userInput field.
  • Add favicon.

Third-party used

  1. BulmaCSS
  2. ClipboardJS
  3. Icons8 for favicon.

Scripts

These scripts can help you connect and make direct calls to the API Endpoint, needs some configuration. These scripts require you to have xclip installed for clipboard interaction, and jq for JSON parsing.

  1. oblique.py, oblique.sh

    Accepts longurl parameter, ./oblique.py longurl_here.

  2. shorten

    A bash script written to access the backend privately configured in order to generate different shortened link compared to the backend. Accepts longurl parameter as the first argument like ./shorten longurl or simply execute the script ./shorten.

Demo of shorten

Backend

Endpoints

Let me use the term BACKEND to denote the server's root domain.

  • POST - BACKEND/create

    link = string (long URL) auth = string (pms by default for now)

  • POST - BACKEND/find

    shortLink = string (shortened URL id)

  • POST - BACKEND/clear (Not quite sure if I want to implement it)

    auth = string (admin key to clear the database)

Modules Used

  1. LowDB
  2. Bluebird Promise
  3. Openode for hosting the backend, not anymore! :D

Thanks to

  1. Random Words API

Fork in a river Fork in a river

Courtesy to @rafasc & @rewt at Freenode#git.