senecajs / seneca-web

Http route mapping for Seneca microservices.
MIT License
76 stars 44 forks source link

seneca-web 3.0.0 with express report error #78

Closed allinwind3344 closed 8 years ago

allinwind3344 commented 8 years ago

To run seneca-web with express sample, got error. seneca: 3.0.0 seneca-web: 0.8.0 express: 4.14.0

below is sample code:

var seneca = require('seneca')() seneca.use(require('seneca-web'))

seneca.add('role:api,cmd:zig',function(args,done){ done(null,{bar:args.zoo+'g'}) })

seneca.add('role:api,cmd:bar',function(args,done){ done(null,{bar:args.zoo+'b'}) })

seneca.add('role:api,cmd:qaz',function(args,done){ done(null,{qaz:args.zoo+'z'}) })

seneca.act('role:web',{use:{

// define some routes that start with /my-api
prefix: '/my-api',

// use action patterns where role has the value 'api' and cmd has some defined value
pin: {role:'api',cmd:'*'},

// for each value of cmd, match some HTTP method, and use the
// query parameters as values for the action
map:{
    zig: true,                // GET is the default
    bar: {GET:true},          // explicitly accepting GETs
    qaz: {GET:true,POST:true} // accepting both GETs and POSTs
}

}})

var express = require('express') var app = express()

// This is how you integrate Seneca with Express app.use( seneca.export('web') )

app.listen(3000)

error message:

Seneca Fatal Error

Message: seneca: No matching action pattern found for { role: 'basic', note: true, cmd: 'push', key: 'admin/units', value: { unit: 'web-service', spec: { title: 'Web Services', ng: [Object] }, content: [ [Object] ] } }, and no default result provided (using a default$ property).

Code: act_not_found

Details: { args: '{ role: \'basic\', note: true, cmd: \'push\', key: \'admin/units\', value: { unit: \'web-service\', spec: { title: \'Web Services\', ng: [Object] }, content: [ [Object] ] } }' }

Stack: at Object.errormaker as error at executable_action (D:\learning\seneca\web\node_modules\seneca\seneca.js:1155:23) at execute_action (D:\learning\seneca\web\node_modules\seneca\seneca.js:875:12) at Object.execspec.fn as orig_fn at Object.timeout_fn as fn at next (D:\learning\seneca\web\node_modules\gate-executor\gate-executor.js:126:14) at process (D:\learning\seneca\web\node_modules\gate-executor\gate-executor.js:175:12) at Immediate. (D:\learning\seneca\web\node_modules\gate-executor\gate-executor.js:258:7) at runCallback (timers.js:570:20) at tryOnImmediate (timers.js:550:5)

Instance: Seneca/fdgvm79c0p27/1472734971146/7660/3.0.0/- ALL ERRORS FATAL: action called with argument fatal$:true (probably a plugin init error, or using a plugin seneca instance, see senecajs.org/fatal.html) at executable_action (D:\learning\seneca\web\node_modules\seneca\seneca.js:1160:22)

When: 2016-09-01T13:02:51.688Z

mcdonnelldean commented 8 years ago

@allinwind3344 We are currently working on updating seneca-web to use the latest frameworks and fix issues. It should be ready in 2 days.

allinwind3344 commented 8 years ago

thanks! looking forward to updating...

ashushahi commented 8 years ago

We are also get same issue. Meantime what will be Seneca-web and Express stable version combinations.

Thanks Ashutosh Shahi

guptakvgaurav commented 8 years ago

I am also getting same error.

[https://github.com/senecajs/seneca/issues/524](Raised issue)

Any workaround as of now for this issue.

natekis6 commented 8 years ago

2 days?

Any update on this?

mcdonnelldean commented 8 years ago

@natekis6 The new version is now on master.

mcdonnelldean commented 8 years ago

Closed with release going out 20 mins.