Skip to content

boukadam/shorty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shorty

Shorty - URL Shortener example implementation using hashids.

Installation

Create a MySQL database

create database shorty; 

Add your custom configuration in application.properties and start the spring boot application :

java -jar target/shorty-0.0.1-SNAPSHOT.jar

Usage

To create a url reduction claim :

$ curl --location --request POST 'http://localhost:1337/claims' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "callback": "http://google.fr?q=Lyon"
    }'

Example of response :

{
    "token": "4K",
    "redirectionUrl": "http://localhost:1337/4K"
}

redirectionUrl is the short URL for http://google.fr?q=Lyon

Limitations

This application is not secure, access to APIs does not require any authentication. For production use, it is your responsibility to implement the appropriate security mechanisms.

License

Apache 2.0 License. See the LICENSE file.

About

Shorty - URL Shortener example implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages