-
Notifications
You must be signed in to change notification settings - Fork 35
fixes #33 discovery mode #48
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,6 +48,14 @@ function createServerFromBaseUri (raml, options) { | |
var app = osprey.Router() | ||
var path = (raml.baseUri || '').replace(/^(\w+:)?\/\/[^/]+/, '') || '/' | ||
|
||
if (options.definition) { | ||
app.use('/resources', function (req, res) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why |
||
var body = '< link:"' + | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the Also, to be clear, this should be returned as a |
||
options.definition + | ||
'" rel="describedby" type="application/raml+yaml">' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
res.end(body) | ||
}) | ||
} | ||
app.use(path, raml.baseUriParameters, createServer(raml, options)) | ||
|
||
return app | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't required an extra parameter here. Instead, we should build the URL based on the API baseUri of the RAML file provided by
-f
.