Skip to content

Commit

Permalink
feat(HTTP): Add HTTP discover function
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Oct 14, 2019
1 parent a1ec214 commit 3f4efef
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/http/discover.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Manifest } from '../base/Executor'
import { HttpAddress } from '../base/Transports'
import HttpClient from './HttpClient'

/**
* Discover `HttpServer` instances.
*
* Currently just fetches a `Manifest` from a single `HttpAddress`.
*/
export default async function discover(
address?: HttpAddress
): Promise<Manifest[]> {
const client = new HttpClient(address)
const manifest = await client.manifest()
return [manifest]
}

0 comments on commit 3f4efef

Please sign in to comment.