Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upgrading modules, adding overiddes for responseMessages, description…
…, consumes, produces, version
- Loading branch information
1 parent
55de68e
commit ec2f34a
Showing
11 changed files
with
122 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
var _ = require('underscore') | ||
var _ = require('lodash') | ||
, routing = require('./routes') | ||
, apifile = require('./api') | ||
, indexfile = require('./index'); | ||
|
||
function swagger(app, options) { | ||
if (!options.title) throw new Error('Please provide a title'); | ||
if (!options.statics) throw new Error('Please specify the location of the swagger ui'); | ||
if (!options.resources) throw new Error('Please sepecify where you would like to store your swagger resources'); | ||
if (!options.applicationUrl) throw new Error('Please specify the url which hosts your swagger resources'); | ||
if (!options.routes) throw new Error('Please provide a list of routes to swagger enable'); | ||
function swagger(app, config) { | ||
if (!config.title) throw new Error('Please provide a title'); | ||
if (!config.statics) throw new Error('Please specify the location of the swagger ui'); | ||
if (!config.resources) throw new Error('Please sepecify where you would like to store your swagger resources'); | ||
if (!config.applicationUrl) throw new Error('Please specify the url which hosts your swagger resources'); | ||
if (!config.routes) throw new Error('Please provide a list of routes to swagger enable'); | ||
|
||
options.routes.forEach(function(route){ | ||
if (!route.page) throw new Error('Please provide a page for route', route); | ||
config.routes.forEach(function(route){ | ||
if (!route.route) throw new Error('Please provide a route name', route); | ||
if (!route.method) throw new Error('Please provide a method for route', route); | ||
if (!route.path) throw new Error('Please provide a path for route', route); | ||
}); | ||
|
||
apifile(options.routes, options.resources); | ||
indexfile(options.routes, options.resources); | ||
routing(app, options); | ||
indexfile(config); | ||
apifile(config); | ||
routing(app, config); | ||
} | ||
|
||
module.exports = swagger; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"apiVersion": "0.0.1", | ||
"apiVersion": "0.1.5", | ||
"swaggerVersion": "1.2.5", | ||
"basePath": "", | ||
"apis": [ | ||
|
Oops, something went wrong.