moleculer-web | Official API Gateway service for Moleculer framework | REST library
kandi X-RAY | moleculer-web Summary
kandi X-RAY | moleculer-web Summary
:earth_africa: Official API Gateway service for Moleculer framework
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Compose middlewares two middlewares
- Compose middlewares and return promise
- Generate fake random data
- Generate ETag from Body .
- Check data freshness .
- Decodes an encoded parameter .
- Removes trailing slashes from a string .
- Returns the full name of a service .
- Add a slashes to a string .
- normalize a path
moleculer-web Key Features
moleculer-web Examples and Code Snippets
Community Discussions
Trending Discussions on moleculer-web
QUESTION
I would like to display all my traces like in the examples from the moleculer-jaeger package:
But what i get is something like this: All spans you can see in this picture should be within the main trace (gateway).
Here is my moleculer.config:
...ANSWER
Answered 2021-Jun-14 at 21:33- This version already has a built-in jager tracer, see the documentation.
- In order for the events to be nested, it is necessary to transfer the context inside the actions, use
ctx.call
calls instead ofbroker.call
, so they will be nested. - To quickly receive support for the moleculer, join us in discord!
QUESTION
I'm using moleculer-web
, how can I get a list of API URLs available.
http://0.0.0.0:4000/~node/actions
shows 404.
ANSWER
Answered 2020-Jun-23 at 17:50The ~
sign is used for internal services referenced by $node.actions
and by default these paths are not available.
To make an internal service available, you must specify:
QUESTION
I am having fun with using moleculer-runner instead of creating a ServiceBroker instance in a moleculer-web project I am working on. The Runner simplifies setting up services for moleculer-web, and all the services - including the api.service.js file - look and behave the same, using a module.exports = { blah }
format.
I can cleanly define the REST endpoints in the api.service.js file, and create the connected functions in the appropriate service files. For example aliases: { 'GET sensors': 'sensors.list' }
points to the list()
action/function in sensors.service.js
. It all works great using some dummy data in an array.
The next step is to get the service(s) to open up a socket and talk to a local program listening on an internal set address/port. The idea is to accept a REST call from the web, talk to a local program over a socket to get some data, then format and return the data back via REST to the client.
BUT When I want to use sockets with moleculer, I'm having trouble finding useful info and examples on integrating moleculer-io with a moleculer-runner-based setup. All the examples I find use the ServiceBroker model. I thought my Google-Fu was pretty good, but I'm at a loss as to where to look to next. Or, can i modify the ServiceBroker examples to work with moleculer-runner? Any insight or input is welcome.
...ANSWER
Answered 2020-Jan-16 at 13:29It doesn't matter if your services use (or not) socket.io. All the services are declared in the same way, i.e., module.exports = {}
Below is a working example with socket.io.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install moleculer-web
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page