mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
13 lines
399 B
TypeScript
13 lines
399 B
TypeScript
import { HttpService } from '../http.service'
|
|
import { MockApiService } from './mock-api.service'
|
|
import { LiveApiService } from './live-api.service'
|
|
import { ConfigService } from '../config.service'
|
|
|
|
export function ApiServiceFactory (config: ConfigService, http: HttpService) {
|
|
if (config.mocks.enabled) {
|
|
return new MockApiService(http)
|
|
} else {
|
|
return new LiveApiService(http)
|
|
}
|
|
}
|