dstevensio / consistency Goto Github PK
View Code? Open in Web Editor NEWhapi.js plugin for API versioning
hapi.js plugin for API versioning
I just ran into the 500 unhandled exception error that was fixed last January. When comparing the npm code with the current master it appears the current master has fixed this issue, but those fixes never got published to npm. It would be great if you could take a couple seconds to get the current master version published on npm. Thanks ๐
if any random word is provided for the version and if there were no handler registered in the application for that random word then server was throwing 500 error instead of 404 error.
Error:
TypeError: Uncaught error: handler is not a function
at /home/sharique/path/to/project/node_modules/consistency/lib/handler.js:76:14
I have created a pull request too to solve this issue. #3
i organize my api like suggested here outmoded/discuss#66, and im trying to version one or more of the pre handlers however it fails when i attempt something like:
'use strict';
const Handlers = require('./handlers');
const Schema = require('./schema');
const internals = {};
module.exports = [
{
method: 'GET',
path: '/version',
config: {
auth: false,
pre: [
{
method: {
versioned: {
'v1.0': (request, reply) => { reply('0.0.1'); },
'v2.0': (request, reply) => { reply('0.0.2'); }
}
},
assign: 'version'
}
],
handler: Handlers.version
}
}
];
it works well when the versioned is the handler itself
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.