Socket
Socket
Sign inDemoInstall

tiny-url-mongoose-express

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tiny-url-mongoose-express

[![install size](https://packagephobia.now.sh/badge?p=tiny-url-mongoose-express@1.0.2)](https://packagephobia.now.sh/result?p=tiny-url-mongoose-express@1.0.2) [![Greenkeeper badge](https://badges.greenkeeper.io/YozhikM/tinyUrl-mongoose-express.svg)](https


Version published
Weekly downloads
12
decreased by-36.84%
Maintainers
1
Weekly downloads
 
Created
Source

TinyUrl-mongoose-express

install size Greenkeeper badge FlowType compatible

This is a simple shortening link, based on Mongoose and Express

Requirements

API

tinyUrlRouter()

tinyUrlRouter(): Router;

TinyUrl

TinyUrl: MongooseModel;

TinyUrlSchema

TinyUrlSchema: MongooseSchema;

{
  _id: number; // start at 100
  url: string; // canonical URL
  createdAt: ?Date; // created automatically
  encodedId: string;
}

How to use

Step 1

yarn add tiny-url-mongoose-express

Step 2

In the schema folder, you need to connect your database. Then connect the router to your Express routing.

// schema
import { TinyUrl } from 'tiny-url-mongoose-express'
// server

import { tinyUrlRouter } from 'tiny-url-mongoose-express';
//
const router = expess.Router();
router.use('/u', tinyUrlRouter());
//

Step 3

Create records in Mongo and use!

TinyUrl.create({ url: 'example.com/hello' });

FAQs

Package last updated on 04 May 2018

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