🚨 Shai-Hulud Strikes Again:More than 500 packages and 700+ versions compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@incodelang/urlshorter

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@incodelang/urlshorter

A simple URL Shorter

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

@incodelang/urlshorter

A simple way to short urls

Installation

Install @incodelang/urlshorter with npm

  npm install @incodelang/urlshorter

Install @incodelang/urlshorter with yarn

  yarn add @incodelang/urlshorter

Usage/Examples

Integrate in your own express.js application

const { urlServer } = require('@incodelang/urlshorter')
const express = require('express')

const app = express();

app.listen(3000, "0.0.0.0");

urlServer({
    app: app,
    prefix: "app" // prefix of the shorted urls
})

Standalone express.js application

const { urlServer, sampleApp } = require('@incodelang/urlshorter')

urlServer({
    app: sampleApp(
        3000, // port [default] = 3000
        "0.0.0.0" // host [default] = "0.0.0.0"
    ),
    prefix: "app" // prefix of the shorted urls
})

API Reference

  GET /api/v1/url/create
ParameterTypeDescription
targetstringThe url target

Returns a JSON Object with the fields error, message and id

View shorted URL

  GET /{prefix}/{id}

Authors

  • @mctzock

License

GPL-3.0

Keywords

URLShorter

FAQs

Package last updated on 02 Mar 2022

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