Gathering detailed insights and metrics for tenancy-moleculer-web
Gathering detailed insights and metrics for tenancy-moleculer-web
Gathering detailed insights and metrics for tenancy-moleculer-web
Gathering detailed insights and metrics for tenancy-moleculer-web
🌍 Official API Gateway service for Moleculer framework
npm install tenancy-moleculer-web
Typescript
Module System
Min. Node Version
Node Version
NPM Version
64
Supply Chain
95.1
Quality
71.6
Maintenance
100
Vulnerability
98.2
License
JavaScript (99.88%)
HTML (0.12%)
Total Downloads
3,500
Last Day
16
Last Week
106
Last Month
356
Last Year
2,688
MIT License
301 Stars
709 Commits
126 Forks
15 Watchers
9 Branches
44 Contributors
Updated on Apr 17, 2025
Minified
Minified + Gzipped
Latest Version
0.10.5
Package Id
tenancy-moleculer-web@0.10.5
Unpacked Size
132.11 kB
Size
35.47 kB
File Count
14
NPM Version
8.5.5
Node Version
16.15.0
Cumulative downloads
Total Downloads
Last Day
0%
16
Compared to previous day
Last Week
103.8%
106
Compared to previous week
Last Month
0.8%
356
Compared to previous month
Last Year
970.9%
2,688
Compared to previous year
11
1
The moleculer-web
is the official API gateway service for Moleculer. Use it to publish your services.
npm install tenancy-moleculer-web --save
This example uses API Gateway service with default settings.
You can access to all services (including internal $node.
) via http://localhost:3000/
1let { ServiceBroker } = require("moleculer");
2let ApiService = require("tenancy-moleculer-web");
3
4let broker = new ServiceBroker({ logger: console });
5
6// Create a service
7broker.createService({
8 name: "test",
9 actions: {
10 hello() {
11 return "Hello API Gateway!"
12 }
13 }
14});
15
16// Load API Gateway
17broker.createService(ApiService);
18
19// Start server
20broker.start();
Test URLs:
Call test.hello
action: http://localhost:3000/test/hello
Get health info of node: http://localhost:3000/~node/health
List all actions: http://localhost:3000/~node/actions
Please read our documentation on Moleculer site
1let { ServiceBroker } = require("moleculer"); 2let ApiMixin = require("tenancy-moleculer-web"); 3 4let broker = new ServiceBroker({ logger: console }); 5 6broker.createService({ 7 name: "test", 8 mixins: [ApiMixin] 9 settings: { 10 port: Number(process.env.PORT || 3000), 11 routes: [ 12 { 13 { 14 path: "/api", 15 authentication: false, 16 tenancy: true, // Check Tenant existed or not? 17 whitelist: ["user.*"], 18 aliases: { 19 "GET /users": "user.list", 20 }, 21 }, 22 } 23 ] 24 }, 25 actions: { 26 hello() { 27 return "Hello API Gateway!" 28 } 29 }, 30 methods: { 31 tenancy(ctx, route, req) { 32 const tenantId = req.headers["x-tenant"] 33 34 if (!tenant) { 35 throw new Errors.MoleculerClientError( 36 ERRORS.Unauthorization.message, 37 ERRORS.Unauthorization.code 38 ); 39 } 40 41 const tenant = { id: tenantId, name: 'Sample Tenant' } 42 // Return info will be mapped into ctx.meta.tenant 43 return tenant 44 } 45 } 46}); 47
$ npm test
In development with watching
$ npm run ci
Moleculer-web is available under the MIT license.
Copyright (c) 2016-2021 MoleculerJS
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
8 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 7
Reason
Found 8/19 approved changesets -- score normalized to 4
Reason
dependency not pinned by hash detected -- score normalized to 4
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
77 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-04-28
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More