Skip to content

zemgalis/optimistic-url-shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Optimistic URL Shortener

Installation

This is NodeJS, Express, TypeScript project.

$ npm install

Running the application

There are two ways how to run the application.

  1. Development mode
$ npm run dev
  1. Production mode
$ npm run build
$ node dist/index.js

API

GET /

Get request returns status to see if an application is running

{
    "data": {
        "status": "online"
    }
}

GET /:shortUrl

Get request returns payload given shortUrl matches long URL

{
    "data": {
        "url": "http://www.example.com",
        "status": "success"
    }
}

POST /shorten

Post request for generating short URL

Request payload

{
    "data": {
        "url": "http://www.example.com"
    }
}

Response payload

{
    "data": {
        "status": "completed",
        "url": $SHORT_URL
    }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published