forked from cerc-io/laconic-console
Use Moustache to create template and set config in page. Use babel plugins to process GQL (and fix GQL queries). Added service type.
20 lines
437 B
JavaScript
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 })
|
|
};
|
|
};
|