-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't run with hapi #140
Comments
I'm confused about that config.context !== seneca.export('web/context')() |
Config.context should be the same as Last I checked the tests for the adapter pass. That build can be seen here -- https://travis-ci.org/senecajs/seneca-web-adapter-hapi/builds/164535179 -- tests here: https://github.com/senecajs/seneca-web-adapter-hapi/blob/master/test/hapi.test.js -- it all looks very similar to yours. That is running an older version of hapi, though - v15 - maybe hapi has been updated and no longer supports this? I do know that koa2 had some similar troubles passing the entire application through seneca-web-adapter-hapi is probably the correct repository for a bug like: https://github.com/senecajs/seneca-web-adapter-hapi/ -- and, I would most definitely need help on any ticket added there. I don't know the first thing about hapi.... more of a connect/express/koa developer. |
I need to invoke the function named "web/mapRoutes" to inject the routes and start the server with config.server |
It's the bug of seneca; |
This is the parts of code:
var config = {
routes: Routes,
adapter: require('seneca-web-adapter-hapi'),
context: Hapi.server({port: 4000})
}
var seneca = Seneca()
.use(SenecaWeb, config)
.ready(async ()=> {
var server = seneca.export('web/context')()
try {
var promise = await server.start() // TypeError: Method Map.prototype.forEach called on incompatible receiver #
console.log('server started on: ' + server.info.uri)
} catch(e) {
console.error('err:', e)
}
})
The text was updated successfully, but these errors were encountered: