Decode bragg URI components
$ npm install --save bragg-decode-components
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();
Decodes the query
and params
object of the bragg context with decodeURIComponent
.
- bragg - AWS λ web framework
- decode-uri-component - A better decodeURIComponent
MIT © Sam Verschueren