UNPKG

ynn-ms-idalloc

Version:

Ynn micro-service module for ID allocation. Supported FlakeID and UUID.

14 lines (11 loc) 311 B
#!/usr/bin/env node const Ynn = require( 'ynn' ); const app = new Ynn( { root : __dirname, routers() { this.router.add( /^\/uuid\/(v[35])/, 'uuid.v35' ); this.router.add( /^\/uuid\/(v[14])/, 'uuid.v14' ); } } ); module.parent || app.listen( Ynn.cargs.port ); module.exports = app;