Skip to content

dududmw/code-matrix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Matrix

Purpose

Manage your code block use middleware model.

Useage

  • Install
npm i code-matrix --save
  • Use
const Router=require('code-matrix').default;
let router=new Router();
router.use('/test/output0',function(next){
    this.text+=0;
    console.log(0);
    next();
});
router.use('/test/output1',function(next){
    this.text+=1;
    console.log(1);
    next();
});
router.use('/test/output2',function(next){
    this.text+=2;
    console.log(2);
    next();
});
router.send({
    whiteList:['/test'],
    blackList:['/test/output1'],
    text:''
}).then(function(context){
    console.log(context.text);
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published