bragg-decode-components

0.2.0 • Public • Published

bragg-decode-components Build Status

Decode bragg URI components

Install

$ npm install --save bragg-decode-components

Usage

const bragg = require('bragg');
const decodeComponents = require('bragg-decode-components');

const app = bragg();
app.use(decodeComponents());
app.use(ctx => {
    console.log(ctx.params);
    //=> {id: 'foo bar'}

    console.log(ctx.query);
    //=> {select: 'unicorn rainbow'}
});

exports.handler = app.listen();

API

decodeComponents()

Decodes the query and params object of the bragg context with decodeURIComponent.

Related

License

MIT © Sam Verschueren

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    6
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    6
  • 0.1.2
    218
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i bragg-decode-components

Weekly Downloads

152

Version

0.2.0

License

MIT

Last publish

Collaborators

  • samverschueren