kori

1.0.0 • Public • Published

Kori

npm package version

a simple route parser;

what is kori?

The kori bustard (Ardeotis kori) is arguably the largest flying bird native to Africa.

how to use it?

const Kori = require('kori');
// or
import Kori from 'kori';
 
const kori = new Kori();
 
const controller = (ctx, ...args) => {
  console.log({ctx, args});
};
 
kori.get('/app/a/b', controller)
.get('/app/*', controller)
.post('/app/user/{id}', controller);
 
kori.handle('https://test.com/app/a/b','GET', 1, 2, 3);
kori.handle('/app/c/b', 'get', 4);
kori.handle('https://test.com/app/user/123', 'POST');

support methods:

const methods = [
  'get', 'post', 'put', 'head', 'delete',
  'options', 'trace', 'copy', 'lock', 'mkcol',
  'move', 'purge', 'propfind', 'proppatch', 'unlock',
  'report', 'mkactivity', 'checkout', 'merge', 'm-search',
  'notify', 'subscribe', 'unsubscribe', 'patch', 'search', 'connect',
];

Readme

Keywords

Package Sidebar

Install

npm i kori

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

86.7 kB

Total Files

9

Last publish

Collaborators

  • acdzh