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

github.com/vancanhuit/url-shortener-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/vancanhuit/url-shortener-api

  • v0.0.0-20241126132443-ecf24bdb62c3
  • Source
  • Go
  • Socket score

Version published
Created
Source

Simple URL Shortener

CI

Install the following tools:

Running test: go test -v -cover ./...

Running API locally:

$ docker compose up -d --build
# NOTE: The generated alias will be different in every run
$ curl -X POST \
        -H "Content-Type: application/json" \
        http://localhost:9000/api/shorten -d '{"url": "https://reddit.com"}'
HTTP/1.1 201 Created
Content-Type: application/json
Date: Tue, 08 Aug 2023 12:54:54 GMT
Content-Length: 69

{"data":{"original_url":"https://reddit.com","alias":"sPQAW_f7HdB"}}

$ curl -i http://localhost:9000/sPQAW_f7HdB
HTTP/1.1 302 Found
Content-Type: text/html; charset=utf-8
Location: https://reddit.com
Date: Tue, 08 Aug 2023 12:55:19 GMT
Content-Length: 41

<a href="https://reddit.com">Found</a>.

$ curl -i -X DELETE http://localhost:9000/sPQAW_f7HdB
HTTP/1.1 204 No Content
Date: Tue, 08 Aug 2023 12:55:49 GMT

FAQs

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