# Service provider

# Scaffold a service provider

yarn ilos generate ServiceProvider
1

Now you've a file in src/ServiceProvider.ts. The service provider is an orchestrator around handlers, here you can define your ioc bindings, register nested service providers, declare middleware. In this example, we just use service provider as handler registry.

# Example

import { Container, Parents } from '@ilos/core';
import { HelloAction } from './action/HelloAction';

@Container.serviceProvider({
  handlers: [
    HelloAction,
  ]
})
export class ServiceProvider extends Parents.ServiceProvider {}
1
2
3
4
5
6
7
8
9