javascript - SailsJS - Create versioned API without blueprint -
I am trying to explain how to create a versionand API for my application. According to this issue, I have to use blueprints, but all the templates have been disabled in my project (my boss's wish).
I have to have a URL like So far, the best way I found is to duplicate all controllers like something to map to all routes like But I think this is an unwise move I am currently using NGNX Div class = "post- At "Aitmprop =" text "> All you need to disable all the blueprints? If you do not want to copy your controllers, then you can try: Then the seal passes all * / to-connector in the "exec_signin" method on your "AuthController". In your controller you have your API version: http: /. /myapi.com/v1/my-custom-route , and for any version.
v322AuthController.js and
'POST / v3.2.2 / se-connecter': 'v322AuthController.perform_signin'
config / routes.js
module.exports.routes = {'post /: apverision / se-connecter': {controller: 'AuthController', verb: 'perform_signin', skipAssets: true} .. ..}
AuthController.js
module.exports = {perform_signin: function (req, res) {Var apverion = req.param ('apverion'); If (apverion === "0.2.0") {....}}}
Comments
Post a Comment