Skip to content

軽量な関数ルーター

License

Notifications You must be signed in to change notification settings

dependahub/router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js Version XO code style

Router

軽量な関数ルーター

インストール

npm install @dependahub/router

使い方

import router from '@dependahub/router';

// ルートを追加
router.add('RouteName', async payload => {
    const {param} = payload;
    return param * 3;
});

// ルートを呼び出し
const response = await router.post('RouteName', {
    param: 3,
});

console.log(response); // 9

// 登録したルート名一覧を取得
const routes = router.list();

console.log(routes); // ['RouteName']

ライセンス

MIT License. 詳細は LICENSE ファイルを参照してください。

About

軽量な関数ルーター

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published