LinkShortener

command module
v0.0.0-...-2acad3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

README

Introduction

This is a simple API that can be used as a backend for a link shortener website.

Endpoints

POST /create

This endpoint allows you to create a short link from a long URL.

Request

Body:

json

{
  "linkid": "a-memorable-link-identifier",
  "link": "a-website.com",
  "createdat": "current-time-in-iso"
}

Response

Status: 200 OK
Body:

json

{
 "status": "Created"
}

This endpoint allows you to retrieve a redirect to a previously shortened URL. Intended for browsers.

Request

Response

Status: 301 MOVED PERMANENTLY
Body:
"The link"

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
src

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL