New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/nurmuh-alhakim18/url-shortener-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/nurmuh-alhakim18/url-shortener-api

  • v0.0.0-20241128091651-790d04981ac2
  • Source
  • Go
  • Socket score

Version published
Created
Source

URL Shortener API

This is a simple REST API for shortening URL. It allows client to shorten the given URL.

Endpoints Overview

MethodEndpointDescription
GET/api/healthCheck readiness of API
POST/api/shortenShorten the long URL provided by user
GET/{alias}Redirect the shortened URL to the long URL

Endpoints

API Health

Check readiness of API Request:
  • Method: GET

  • URL: /api/health

  • On Success Status Code: 200

  • Response:

    • 200 OK

Shorten URL

Shorten a long URL provided by user Request:
  • Method: POST

  • URL: /api/shorten

  • Headers:

    • Content-Type: application/json
  • Request Body:

    • custom_alias string unique: Alias which will be used for redirection.
    • original_url string: URL shortening target.
  • On Success Status Code: 201

  • Request Example:

    {
      "custom_alias": "lol",
      "original_url": "https://leagueoflegends.com"
    }
    
  • Response Example:

    {
      "generated_link": "https://url-shortener-836536565354.asia-southeast2.run.app/lol"
    }
    

Redirect URL

Redirect the shortened URL to the long URL Request:
  • Method: GET

  • URL: /{alias}

  • On Success Status Code: 200

  • Response:

    • 200 OK

FAQs

Package last updated on 28 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc