Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Aug 07 13:10
    disce-omnes opened #1115
  • Aug 05 09:47
    HaiBien commented #1114
  • Aug 05 08:31
    intech commented #1114
  • Aug 05 07:25
    HaiBien commented #1114
  • Aug 05 07:10
    lucduong commented #1114
  • Aug 05 07:01
    HaiBien opened #1114
  • Aug 04 18:44
    Vslava commented #1105
  • Aug 04 12:31
    shawnmcknight commented #1113
  • Aug 04 10:56
    disce-omnes commented #1113
  • Aug 04 08:43

    icebob on master

    fixed the issue with setting tr… lint fixed metrics options with env variab… and 1 more (compare)

  • Aug 04 08:43
    icebob closed #1112
  • Aug 04 07:03
    AndreMaz commented #1105
  • Aug 04 06:49
    prasadmadanayake commented #1112
  • Aug 04 06:44
    prasadmadanayake edited #1112
  • Aug 04 06:40
    prasadmadanayake edited #1112
  • Aug 04 06:37
    prasadmadanayake synchronize #1112
  • Aug 03 22:54
    ccampanale commented #1113
  • Aug 03 19:49
    AndreMaz commented #1105
  • Aug 03 19:35
    intech commented #1113
  • Aug 03 19:34
    intech commented #1113
Zeeshan Haider
I listed that issue on github as well
still no solution may be I am missing something
Mohammad Majid Khan
how to upload file using multer in moleculer
any one have idea i don't want to use busboy for file upload
Bruno Carneiro

Hi there.
How do I change bodyparser json limit in moleculer-web?

    name: "api",
    mixins: [
   settings: {
        routes: [
                authentication: true,
                whitelist: [
                aliases: {
                    '/': 'api.ok',
                bodyParsers: {
                    json: { limit: "5MB" },
                    urlencoded: { extended: true, limit: "5MB" }

But don't work =/

Screen Shot 2020-08-30 at 09.45.29.png
I have problems about start services. Can you help me, please?
Satish Adabala

Being a newbie to moleculerjs I'm trying to use passport with moleculerjs for authorization using Azure AD passport plugin. Thanks to the mixin https://github.com/icebob/kantab/blob/master/backend/mixins/passport.mixin.js by @icebob I'm able to apply the authorization at the alias level in API gateway service successfully. Now I'm trying to extend this functionality by using this mixin in a dedicated identity service that does the authentication and authorization based on the service name passed to it. I was thinking of using the authorize method of API gateway to forward the requests to identity service if theauthorization route setting is set to true. However, when I call the identity service using ctx.call method the passport mixin is not being invoked! Here is my authorize method.

    async authorize(ctx, route, req) {
      let verified;
        // Verify JWT token
        try {
          verified = await ctx.call("identify.verifyToken");
          if (verified) {
            this.logger.info("Authenticated via JWT: ", user.username);
            ctx.meta.user = _.pick(user, ["_id", "username", "email", "image"]);
            ctx.meta.token = token;
            ctx.meta.userID = user._id;
        } catch (err) {
          throw new UnAuthorizedError(ApiGateway.Errors.ERR_INVALID_USER);

and here is the snippet of my identity service

const passportMixin = require("../mixins/passport.mixin");
module.exports = {
  name: "identity",
  mixins: [passportMixin({ successRedirect: "/api/v1/customer" })],
  settings: {
    routes: [],
    aliases: {},
    actions: {
      verifyToken: {
        rest: "GET /verify",
        async handler(ctx) {
          try {
            console.log("Token is being verified");
          } catch (err) {

The passport mixin is defined to apply passport plugin at alias level like below and the callback is set to forward the request to a customer service

        route.aliases["GET /verify"] = (req, res) =>
          passport.authenticate("oauth-bearer", { session: false })(
            callback(req, res)

I would've thought the identity service invokes the passport plugin before running the verifyToken method but the plugin doesn't get invoked and only the method is run printing the debug statement. My question is can I use passport mixin in other services than API gateway service and if so, what am I doing wrong here?

Thanks in advance!

Zeeshan Haider
I want to build a File Upload Rest Api
What is the best practice
Zeeshan Haider
How to disable JSON body parser for file uploads
for the specific route or service
I cant publish image
help me
Hoàng Thành
@thachnhanhbl : I dont think u need to put /public/ in url
just localhost:3000/filename.jpg
thanks for support
Screen Shot 2020-12-21 at 12.34.58 AM.png
Screen Shot 2020-12-21 at 12.35.15 AM.png
help me how to config return oject, not array. thanks
i want to cofig image single
Hoàng Thành

Screen Shot 2020-12-21 at 12.35.15 AM.png

Your question not clear... if u want fast response just go discord channel https://discord.com/channels/585148559155003392/585148559754657799

Nguyễn Phước Nguyên
hello, I want to deploy 2 moleculer in a server. how to install the server? thanks
const busBoy = new Busboy({ headers: "" });
busBoy.on("file",(fieldname, file, filename, encoding, mimetype) => {
I am gettin this error. 'Header are already sent'. What does this mean? I received an excel file and now I am trying to read its data but getting an error
what do i need to set in headers?
const busBoy = new Busboy({ headers: "" }); busBoy.on("file",(fieldname, file, filename, encoding, mimetype) => { console.log(filename,fieldname,mimetype,file,encoding); });
"name": "MoleculerClientError",
"message": "File missing in the request",
"code": 400
Can anyone tell why this is saying file is missing. I am sending an excel file here
Nhanh Thach
Hi all, I can't to populate with sequelize mssql ?
Am I right that the page shown when accessing localhost:3000 is just a static page?
I thought it was dynamically generated based on your services but it seems it's not...
PerJer Official
There is a custom a sample ?.
Caleb Adewole
@icebob please how do I resolve the nat-server issues after successfully building the docker image and push to heroku . But It seems nats-server can not be found/installed on heroku
or how can i make a live deployment of my microservice container?
Ryan DeGaris

Why does APIGateWay convert number params to string? E.g


console.log (ctx.params)
{ page: '10' }

Any ideas? Is it the JSON serializer? Seems like a bug


Hi guys, I'm slowly digging into this cool framework and I'm noticing something a bit off;

If you have 2 moleculer-web services (let's say the default api service and an extra http service running on a different port), the second one seems to cause a "service is not registered" issue on remote (rest) not local (repl call).

How would I get those 2 moleculer-web not conflicting so I could provide a differentiated local and remote access based on ports? Is it a config glitch or just not intended to run that way?
Thanks in advance for your feedbacks

I'm really having a hell of a time with finding doc and making sense of what should be easy to figure out (like how to use the adapter to add a sorted list, how to serve specific static files or properly handling pagination with optional parameter as the pageSize cannot be -1 or >100), it slowly discourages me :(
@rdegaris I had something similar. After adding the constraint:
page: "number|integer|positive"
I had to remove it because the passed parameter wasn't considered to be a number type :/
Thomas Greenhalgh

hey all,

When I go to the generic API endpoint, I get information about the system

"cpu": {
"load1": 0.25,
"load5": 0.27,
"load15": 0.16,
"cores": 2,
"utilization": 12
"mem": {
"free": 541687808,
"total": 4073267200,
"percent": 13.298607270350445
"os": {

etc, etc

Is there a way to turn that off?

hey all,
anyone knows why adding a middleware breaks ctx.meta.$responseType?
with serviceguard middleware enabled, an action returns json, while without middleware it returns text/html as it supposed to
the middleware itself is simple and has nothing to do with ctx.meta.$responseType:
import { Errors } from 'moleculer'
import { AuthContext } from '../dto/auth.dto'

const ServiceGuard = {
    localAction(next, action) {
        return async function ServiceGuardMiddleware(ctx: AuthContext) {
            if (!action.restricted) return await next(ctx)
            const token = ctx.meta.$authToken
            if (!token)
                throw new Errors.MoleculerClientError(
                    'Service token is missing',

            // TODO: cache the response because it won't change in runtime.
            await ctx.call('guard.check', { token, services: action.restricted })

            return await next(ctx)

    call(next) {
        return async function (actionName, params, opts: any = {}) {
            if (opts.parentCtx) {
                const { service } = opts.parentCtx
                const token = service.schema.authToken

                if (!opts.meta) opts.meta = opts.parentCtx.meta || {}
                opts.meta.$authToken = token
            return await next(actionName, params, opts)
export default ServiceGuard
Hi, can i get some examples without moleculer runner ?
Hey, is it possible to use passport js with moleculer? I've tried it.. with settings.use and some routes, like in express, but i does not work. Any ideas?.