[](https://packagephobia.now.sh/result?p=tiny-url-mongoose-express@1.0.2) [](https
npm install tiny-url-mongoose-express

!FlowType compatible
This is a simple shortening link, based on Mongoose and Express
* express
* mongoose
* mongoose-plugin-autoinc
``js`
tinyUrlRouter(): Router;
`js`
TinyUrl: MongooseModel;
`js
TinyUrlSchema: MongooseSchema;
{
_id: number; // start at 100
url: string; // canonical URL
createdAt: ?Date; // created automatically
encodedId: string;
}
`
``
yarn add tiny-url-mongoose-express
In the schema folder, you need to connect your database. Then connect the router to your Express routing.
`js`
// schema
import { TinyUrl } from 'tiny-url-mongoose-express'
`js
// server
import { tinyUrlRouter } from 'tiny-url-mongoose-express';
//
const router = expess.Router();
router.use('/u', tinyUrlRouter());
//
`
Create records in Mongo and use!
```
TinyUrl.create({ url: 'example.com/hello' });