Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

awkkih/shortener

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

shortener πŸ”—

a simple and intuitive link shortener API. :D

how to install ❓

  1. clone the repository by using git clone https://github.com/eiyaxz/shortener.git.
  2. install the project's dependencies using npm install.
  3. run npm run start and use a tool like insomnia to make requests to the api.

Note

the default port is 3333. you can change that in src/server.ts.

endpoints πŸ”š

GET *

default catch-all route.

  • response (404):
    {
      "error": "Page not found"
    }

POST /short

creates a new short link.

  • body:

    {
      "url": "https://google.com/"
    }
  • response (201):

    {
      "short": "2796e032"
    }
  • response (400):

    {
      "error": "Invalid URL"
    }

GET /:short

finds the original link associated with the given code.
automatically redirects you to the associated page.

  • path parameters:
    short - the short's code.

  • response (404):

    {
      "error": "Short not found"
    }

About

A simple and intuitive link shortener API.

Topics

Resources

Stars

Watchers

Forks

Contributors