{"library":"moleculer-web","title":"Moleculer API Gateway","description":"moleculer-web is the official API Gateway service for the Moleculer microservices framework. It enables publishing Moleculer services via HTTP/HTTPS, handling routing, middleware, authentication, authorization, and static file serving. Key features include multiple routing strategies (aliases, named parameters, REST shorthand), support for file uploads, CORS, ETag generation, HTTP/2, and rate limiting. It supports various body parsers (JSON, URL-encoded) and can act as a middleware in existing ExpressJS applications. The current stable version is 0.11.0, released recently. The project appears actively maintained with frequent updates, including breaking changes in major versions for Node.js compatibility and dependency updates, indicating a steady, albeit evolving, release cadence.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install moleculer-web"],"cli":null},"imports":["import ApiService from 'moleculer-web';","import { ApiGatewayErrors } from 'moleculer-web';","import { RateLimitStores } from 'moleculer-web';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { ServiceBroker } from 'moleculer';\nimport ApiService from 'moleculer-web';\n\nconst broker = new ServiceBroker({ logger: console });\n\n// Create a dummy service to expose via the API Gateway\nbroker.createService({\n    name: 'test',\n    actions: {\n        hello(): string {\n            return 'Hello API Gateway!';\n        }\n    }\n});\n\n// Load the API Gateway service\nbroker.createService(ApiService);\n\n// Start the broker and API Gateway\nbroker.start()\n    .then(() => {\n        console.log('Moleculer API Gateway started on http://localhost:3000');\n        console.log('Test URLs:');\n        console.log('- Call \"test.hello\" action: http://localhost:3000/test/hello');\n        console.log('- Get node health info: http://localhost:3000/~node/health');\n    })\n    .catch(err => {\n        console.error('Error starting Moleculer broker or API Gateway:', err);\n    });\n","lang":"typescript","description":"This quickstart demonstrates how to instantiate a Moleculer ServiceBroker and integrate the moleculer-web API Gateway to expose a simple service via HTTP, providing immediate access to actions and system endpoints.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}