Skip to content

kathulhur/url-shortener

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn

Built With

(back to top)

Description

A url shortener API

https://ikzi.ml make use of this API. Developed by my web developer friend, goriio.

API Base

https://short-url-webapp.herokuapp.com/

Shortening a link

/shorten

Example

GET/POST: https://short-url-webapp.herokuapp.com/shorten?url=www.google.com

Response

{
  "apiVersion":"0.0.1",
  "data":{
    "urlCode":"dQJken_i",
    "longUrl":"https://www.google.com",
    "shortUrl":"https://short-url-webapp.herokuapp.com/dQJken_i",
    "date":"2022-06-21T14:54:28.525Z"
  }
}

Getting information on a link

/info

This gets the information about the link. This requires a 'code' query parameter having the short url code. Example: https://short-url-webapp.herokuapp.com/thisisacode → Code: thisisacode

Example

GET/POST: https://short-url-webapp.herokuapp.com/info?code=www.google.com

Response

{
  "apiVersion":"0.0.1",
  "data":{
    "urlCode":"dQJken_i",
    "longUrl":"https://www.google.com",
    "shortUrl":"https://short-url-webapp.herokuapp.com/dQJken_i",
    "date":"2022-06-21T14:54:28.525Z"
  }
}

Roadmap

  • Custom error response
  • Home Page
  • Custom Domain

See the open issues for a full list of proposed features (and known issues).

(back to top)

Setting up locally

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Stay in touch

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Joseph - josephkarl19@gmail.com

Project Link: https://github.com/kathulhur/url-shortener

(back to top)