Hi!
I'm currently running an instance of swagger node express plan to serve
multiple swagger documents on one machine.
What I want to do is change my configuration to serve the swagger yaml to a
different path other than /api-docs
I've made the change when initializing swagger ui but that doesnt mean the
app itself is hosting the document there.
'use strict';
var SwaggerExpress = require('swagger-express-mw');
var SwaggerUi = require('swagger-tools/middleware/swagger-ui');
var app = require('express')();
module.exports = app; // for testing
var configs = ['client'];
for(var i in configs) {
var config = {
appRoot: __dirname, // required config
swaggerFile: __dirname + "/api/swagger/" + configs[i] + "_swagger.yaml",
}
SwaggerExpress.create(config, function(err, swaggerExpress) {
if (err) { throw err; }
// enable SwaggerUI
var options = {
apiDocs: "api-" + configs[i] + "-docs",
swaggerUi: "/" + configs[i]
}
app.use(SwaggerUi(swaggerExpress.runner.swagger, options));
// install middleware
swaggerExpress.register(app);
var port = process.env.PORT || 10010;
app.listen(port);
console.log("Swagger 2.0 instance of the client api");
});
}
Also, if I do get over this hurdle I don't believe it'll work due to having
multiple express applications on the same port, please advise
--
You received this message because you are subscribed to the Google Groups
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.