Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Give opts to Osprey Router tu be able to do RAML10 #74

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions osprey-mock-service.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ module.exports.loadFile = loadFile
* @param {Object} raml
* @return {Function}
*/
function ospreyMockServer (raml) {
return resources(raml.resources, handler)
function ospreyMockServer (raml, routerOpts) {
return resources(raml.resources, handler, routerOpts)
}

/**
Expand All @@ -28,10 +28,11 @@ function ospreyMockServer (raml) {
* @return {Function}
*/
function createServer (raml, options) {
var app = osprey.Router()
var routerOpts = { RAMLVersion: options.RAMLVersion };
var app = osprey.Router(routerOpts)

app.use(osprey.server(raml, options))
app.use(ospreyMockServer(raml))
app.use(ospreyMockServer(raml, routerOpts))
app.use(osprey.errorHandler())

return app
Expand Down
Loading