Skip to content

adarshM84/url-shortner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URL Shortener (# url-shortner)

Note: The backend is completed, UI is under development.

Prerequisites

  • Node > 14
  • Golang
  • npx

How to Use?

Clone the Project

Clone the repository to your local machine.

Go to Project Directory

Navigate to the project directory:

cd url-shortener

To Run Server

  1. Navigate to the server directory:
    cd bin/server
  2. Run the server:
    ./urlshortener

To Run Client

  1. Navigate to the client directory:
    cd client
  2. Install dependencies and start the client:
    npm install
    npm start

Functionality

  1. Login

    • You can login on the UI with the default username (admin) and password (admin).
  2. Backend API

    • The backend is built on REST and can be used directly.

Available APIs

Get Short URL

  • Endpoint: GET /api/urlshort/getshort/{url}/{expiry}
  • Description: Replace {url} with the base64 encoded URL and {expiry} with the URL TTL in minutes.
  • Example:
    /api/urlshort/getshort/aHR0cDovL3Rlc3QuY29t/5
    • Here, aHR0cDovL3Rlc3QuY29t is the base64 encoding of http://test.com.

Get Original URL

  • Endpoint: GET /api/urlshort/getorigin/{url}
  • Description: This URL is received in the response of the previous endpoint.
  • Example:
    /api/urlshort/getorigin/j3lbs8

Delete URL

  • Endpoint: DELETE /api/urlshort/delete/{url}
  • Description: Replace {url} with the last part of the URI from the getorigin API.
  • Example:
    /api/urlshort/delete/j3lbs8

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 45.0%
  • Go 33.9%
  • CSS 12.6%
  • HTML 8.5%