Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

To make the api more dynamic let's introduce defaulthandler #71

Merged
merged 4 commits into from
Nov 30, 2016

Conversation

dankle
Copy link
Contributor

@dankle dankle commented Oct 19, 2016

In our project we don't use the file mappings for the handlers but we use this module for generating the base of the route and then in a later stage add a default handler for all the routes. This is because we have our handlers refers to a js file that handles the logic for the different routes.

This PR integrates this functionality directly in swaggerize-routes which is very useful if you just want one handler for all routes.

Example:

var builder = require('swaggerize-routes');

var routes = builder({
    api: require('./api.json'),
    defaulthandler: function (req, reply) {
       reply.('something');
    },
    security: './security' //Optional - security authorize handlers as per `securityDefinitions`
});

@subeeshcbabu-zz
Copy link
Member

@dankle Can you update the README also for this.

@dankle
Copy link
Contributor Author

dankle commented Oct 25, 2016

@subeeshcbabu Sure, updated now.

Copy link
Member

@subeeshcbabu-zz subeeshcbabu-zz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@dankle
Copy link
Contributor Author

dankle commented Nov 17, 2016

@subeeshcbabu do you have a current plan for next release? Or maybe an estimate when it can be available?

@subeeshcbabu-zz subeeshcbabu-zz merged commit 4cff46f into krakenjs:master Nov 30, 2016
@subeeshcbabu-zz
Copy link
Member

@dankle - I am planning to release the changes by End of this week.

@subeeshcbabu-zz
Copy link
Member

@dankle
Copy link
Contributor Author

dankle commented Dec 5, 2016

@subeeshcbabu - Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants