laconic-console/packages/console-app/src/hooks/registry.js
richburdon eb6bcd9c95 Server Console App directly from the server.
Use Moustache to create template and set config in page.
Use babel plugins to process GQL (and fix GQL queries).
Added service type.
2020-05-27 19:09:20 -04:00

20 lines
437 B
JavaScript

//
// Copyright 2020 DxOS.org
//
import { Registry } from '@wirelineio/registry-client';
import { getServiceUrl } from '../util/config';
export const useRegistry = (config) => {
const endpoint = getServiceUrl(config, 'wns.server', { absolute: true });
const registry = new Registry(endpoint);
return {
registry,
// TODO(burdon): Separate hook.
webui: getServiceUrl(config, 'wns.webui', { absolute: true })
};
};