Use it for Kubernetes liveness & readiness checks. The middleware opens a HTTP server on port 3001. To check, open the http://localhost:3001/live & http://localhost:3001/ready URL.
{
"state": "up",
"uptime": 7.419,Use it for Kubernetes liveness & readiness checks. The middleware opens a HTTP server on port 3001. To check, open the http://localhost:3001/live & http://localhost:3001/ready URL.
{
"state": "up",
"uptime": 7.419,| "use strict"; | |
| const _ = require("lodash"); | |
| const chalk = require("chalk"); | |
| const Promise = require("bluebird"); | |
| const ServiceBroker = require("../src/service-broker"); | |
| const { MoleculerError } = require("../src/errors"); | |
| // --- SAGA MIDDLEWARE --- | |
| const SagaMiddleware = function() { |
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_SALTenvironment 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 |