automatic service registration à la Svelte
This commit is contained in:
@@ -3,7 +3,7 @@ import { config, stripPrivateFields, type Config, type ServiceConfig } from '$li
|
||||
import type { PageServerLoad } from './$types';
|
||||
import * as yml from 'js-yaml';
|
||||
import { readFile } from 'fs/promises';
|
||||
import { getService } from '$lib/services/service';
|
||||
import { getService } from '$lib/services/services';
|
||||
|
||||
async function reloadConfig(): Promise<Config> {
|
||||
if (dev) {
|
||||
@@ -34,6 +34,7 @@ export const load: PageServerLoad = async ({ fetch, depends }) => {
|
||||
const clientService = clientGroup.items[service] as ServiceConfig;
|
||||
|
||||
const [handler, type] = getService(serverService.type || '');
|
||||
|
||||
clientService.type = type;
|
||||
Object.assign(clientService, handler({ fetch, config: serverService }));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user