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

github.com/raiesbo/url-minifier

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/raiesbo/url-minifier

  • v0.0.0-20240923054911-2b58a8be9ebc
  • Source
  • Go
  • Socket score

Version published
Created
Source

URL Minifier

API that allows creating shorter URLs for any project.

In many cases, some URLs that we want to share, or directly from our own project, are excessively long and verbose. With this application, users can obtain a concise version of a URL through a straightforward HTTP POST request.

The application provides two distinct interfaces. On one hand, there is the Visual interface located at the root URL /, which renders a web page with a form for entering the URL to be shortened. On the other hand, the application exposes a public JSON API, enabling the integration of third-party applications with the same objective.

The entire application is written entirely in Go.

Overview

System

Project system diagram

Features

  • The user is able to obtain a shortened URL through a graphical interface
  • The user is able to obtain a minified URL through a JSON API
  • The user is able to check the original URL based on a given secret key.
  • The user is able to remove the minified URL based on a given secreat

Exposed API

EndpointHTTP VerbRequest BodyAction
/{url_key}GETForwards to target URL
/api/urlPOSTYour target URLCreates URL
/api/url/{secret_key}GETRetrieves URL information
/api/url/{secret_key}DELETERemoves URL
/api/adminPOSTSecret passwordRetrives list of URLs

Getting Started

Setup

  1. Install Go v1.21 or above
  2. Create a .env file in the root of the project with the variables listed below
  3. Run go mod download to install all the dependencies
  4. Run go build -o app to compile the project
  5. Run ./app to run the server from the created binary file

Environment Variables

  • DB_URI: MongoDB connection URI connection
  • PORT: Port in which the project will run

Tech stack

FAQs

Package last updated on 23 Sep 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