Skip to content

ayushbasak/chotaurl-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ChotaURL-api


Rest API for url shortening / obfuscation and pastebin clone

Installation

  • run $ npm install
  • create a .env file and add DB_URI=<your postgres database uri>
  • run schema.sql to create tables for your database

You can get away by not integrating Auth0.

Usage

If using localmachine, use localhost otherwise use ctlnk

  1. URL Shortener / obfuscator

  • GET https://ctlnk.herokuapp.com/q/<shortened url id>
  • POST https://ctlnk.herokuapp.com/q/
    {
      url: '<URL to be shortened>',
      flavor: '<your endpoint name>' [optional]
    }
  1. Pastebin Clone

  • GET https://ctlnk.herokuapp.com/p/<id>
  • POST https://ctlnk.herokuapp.com/p/
    {
        title: '<title of content>',
        content: '<your content>',
        language: '<programming language if any>' [optional]
    }

ErrorIds

  • 1 ERROR_CREATION
  • 2 ERROR_INVALID_URL
  • 3 ERROR_AUTHENTICATION [Admin Authentication]
  • 4 ERROR_INVALID_USER

My deployed version

site | github

License: [ MIT ]

About

a url shortener / obfuscater REST API

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors