Platformatic Composer
Platformatic Composer is an HTTP server that automatically aggregates multiple services APIs into a single API.
Features
- Command-line interface:
platformatic composer
- Automatic OpenApi composition
- Reverse proxy for composed services
- Add custom functionality in a Fastify plugin
- Write plugins in JavaScript or TypeScript
Issues
If you run into a bug or have a suggestion for improvement, please raise an issue on GitHub.
Standalone usage
If you're only interested in the features available in Platformatic Composer, you can replace platformatic
with @platformatic/composer
in the dependencies
of your package.json
, so that you'll import fewer deps.
Example configuration file
The following configuration file can be used to start a new Platformatic Composer project. For more details on the configuration file, see the configuration documentation.
{
"$schema": "https://platformatic.dev/schemas/v0.26.0/composer",
"server": {
"hostname": "127.0.0.1",
"port": 0,
"logger": {
"level": "info"
}
},
"composer": {
"services": [
{
"id": "auth-service",
"origin": "https://auth-service.com",
"openapi": {
"url": "/documentation/json",
"prefix": "auth"
}
},
{
"id": "payment-service",
"origin": "https://payment-service.com",
"openapi": {
"url": "/documentation/json"
}
}
],
"refreshTimeout": 1000
},
"watch": true
}