This middleware can connect to other namespaces.
moleculer.config.js
const InterNamespaceMiddleware = require("./inter-namespace.js");
This mixin created two methods to encode & decode your IDs in order to be more secure. Read more about it in hashids.js readme. It generates a Youtube-like ID from Number IDs or Mongo ObjectID.
Please note, you should define a salt for HashID with
HASHID_SALT
environment variables.
const SecureID = require("../mixins/secure-id.mixin");
It supports using MongoDB at development & production and using NeDB at unit testing.
NODE_ENV=test
).NEDB_FOLDER
is defined.NODE_ENV=test TEST_E2E=true
).posts.entity.created
, posts.entity.updated
, posts.entity.removed
const { ServiceBroker } = require('moleculer'); | |
let broker = new ServiceBroker({ | |
logger: console, | |
logLevel: 'info', | |
transporter: "nats://demo.nats.io:4222" | |
}); | |
broker.createService({ | |
name: 'math', |
"use strict"; | |
// Generate webpack config with CLI service | |
const webpackConfig = require("@vue/cli-service/webpack.config.js"); | |
// Create express app | |
const express = require("express"); | |
const app = express(); | |
// Configure webpack as middleware |
"use strict"; | |
const defaultsDeep = require("lodash/defaultsDeep"); | |
/** | |
* | |
* | |
* @class StatRequestStore | |
*/ | |
class StatRequestStore { |
const MyService = { | |
name: "my", | |
actions: { | |
getImportantData() { | |
return ctx.call("other.get") | |
.then(res => { | |
return { | |
id: 1, | |
data: res | |
}; |