Skip to content

Commit 3f4efef

Browse files
committed
feat(HTTP): Add HTTP discover function
1 parent a1ec214 commit 3f4efef

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/http/discover.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Manifest } from '../base/Executor'
2+
import { HttpAddress } from '../base/Transports'
3+
import HttpClient from './HttpClient'
4+
5+
/**
6+
* Discover `HttpServer` instances.
7+
*
8+
* Currently just fetches a `Manifest` from a single `HttpAddress`.
9+
*/
10+
export default async function discover(
11+
address?: HttpAddress
12+
): Promise<Manifest[]> {
13+
const client = new HttpClient(address)
14+
const manifest = await client.manifest()
15+
return [manifest]
16+
}

0 commit comments

Comments
 (0)