Services
The services are the main building blocks of the Front-Commerce architecture. They are responsible for handling the business logic and the data of the application.
note
For a full list please see the Services implementation.
Global Services
These services are instantiated when the server starts and are propagated to the
onServerInit
lifecycle hook. They are singletons and their lifecycle is tied
to the server's lifecycle.
Name | Description | Reference |
---|---|---|
RateLimiter | Used to rate limit a resource | 📖 Guide 🔗 Code |
MaintenanceMode | Used to manage the maintenance mode | 📖 Guide 🔗 Code |
Server Services
These services are instantiated per request and are propagated to the
onServerServicesInit
lifecycle hook. They are scoped to the current request
and are destroyed when the request is completed, with the exception of
RateLimiter
and MaintenanceMode
.
Name | Description | Reference |
---|---|---|
ContentMetadataExtractorRegistry | Used for storefront content registration | 📖 Guide 🔗 Code |
ServerEventBus | Used for server events publishing | 📖 Guide 🔗 Code |
Sitemap | Used for sitemap registration | 📖 Guide 🔗 Code |
DI | Used for Dependency Injection registration | 📖 Guide 🔗 Code |
ExternalLogin | Used for External login providers | 📖 Guide 🔗 Code |
DynamicRoutes | Used to serve url rewrites | 📖 Guide 🔗 Code |
RateLimiter | Instance from Global Services | - |
MaintenanceMode | Instance from Global Services | - |
CacheControl | Used to add Cache-Control headers to requests | 📖 Guide 🔗 Code |
ServerTimings | Used to add Server-Timing headers to responses | 🔗 Code |
MetricsService | Used to register metrics for outbound requests | 📖 Guide 🔗 Code |