Skip to content

ynnjs/ynn-middleware-hierarchical-param

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ynn-middleware-hierarchical-param

A ynn middleware for getting params of requests hierarchically.

Installation

$ npm install --save ynn-middleware-hierarchically-param

Usage

const Ynn = require( 'ynn' );
const param = require( 'ynn-middleware-hierarchical-param' );

const app = new Ynn( {
    root : __dirname,
    debugging : true
} );

/**
 * the middleware will try getting "param" from headers and cookie,
 * and add a property to ctx with name "prop"
 */
app.use( param( 'param', 'prop', [ 'header', 'cookie' ] ) );

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published