0.3.0 • Published 5 years ago

anyflow v0.3.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

anyflow

npm

npm jsdelivr

NOT only http server need middleware !!

HOW-TO-USE

const { App } = require('anyflow');
const app = new App();
// use function as middleware
app.use(async (context, next) => {
    // you can get or set data from context.data
    return await next(); // call next middleware
});
// or use middleware
app.use({
    invoke: async (context, next) => {
        return await next();
    }
});
// or use middleware factory
app.useFactory({
    get: () => ({
        // factory allow you make a new middleware for each times.
        invoke: async (context, next) => {
            return await next();
        }
    })
});
// then run middleware chain.
app.run();

reference

  • Asp.Net Core middleware
0.3.0

5 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago