Skip to content
/ URLShortener Public template

A simple API to parse long URL to a shorter version, and retrieve the longer version from the latter.

License

Notifications You must be signed in to change notification settings

megibyan/URLShortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URLShortener

Build Status

Overview

A simple API to parse long URL to a shorter version, and retrieve the longer version from the latter.

URLShortener builds upon libz, Boost, Served, and Crypto++.

Features:

  • ✅ Shorten longer URL
  • ✅ Retrieve original long URL from a short one, if possible

Installation

Requirements

Provided endpoint

Endpoint Purpose
/encode shorten a URL
/decode try to retrieve longer version of a URL

For detailed information see ../Auxiliary/Documentation/html/index.html

System Compatibility

OS Compiler Status
OSX Intel Clang 13.0 Working
OSX Intel Clang 12.0.5 Working
OSX ARM Clang 12.0.5 Working

Building

$ git clone https://github.com/megibyan/URLShortener.git
$ cd URLShortener
$ mkdir Build && cd Build
$ cmake ../ && make -j12

or use Build.sh located at Auxiliary/Scripts

$ ./Build

Usage

$ ./URLShortener

In a separate tab:

$ curl --header "Content-Type: application/string" --request POST --data "google.com" http://localhost:8080/encode
$ curl --header "Content-Type: application/string" --request POST --data "https://url.short/KbLNv" http://localhost:8080/decode

or use URLShortener.sh (on Intel only) located at Auxiliary/Scripts

$ cd ../URLShortener/Scripts
$ ./URLShortener -e "google.com"
$ ./URLShortener -d "https://url.short/KbLNv"

Testing

$ cd ../Build
$ make Test -j12 && ./Test

or use Test.sh located at Auxiliary/Scripts

$ ./Test

Future improvements

  • Support for other OSs.
    • This should be as simple as building third party dependencies for the platforms.
  • Third party dependencies should have better place to live.

Limitations

  • Current encoding guarantees the uniqueness but doesn't guaranty the short URL length.

About

A simple API to parse long URL to a shorter version, and retrieve the longer version from the latter.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published