Function
get
(
web: {
readonly handler: (request: Request, context: Context.Context<never>) => Promise<Response>;
},
path: string,
credential?: string,
)
Source from the content-addressed store, hash-verified
| 304 | ); |
| 305 | |
| 306 | const get = ( |
| 307 | web: { |
| 308 | readonly handler: (request: Request, context: Context.Context<never>) => Promise<Response>; |
| 309 | }, |
| 310 | path: string, |
| 311 | credential?: string, |
| 312 | ) => |
| 313 | Effect.promise(() => |
| 314 | web.handler( |
| 315 | new Request(`http://localhost${path}`, { |
| 316 | headers: credential ? { authorization: credential } : {}, |
| 317 | }), |
| 318 | Context.empty(), |
| 319 | ), |
| 320 | ); |
| 321 | |
| 322 | const jsonOf = <A>(response: Response) => Effect.promise(() => response.json() as Promise<A>); |
| 323 | |
Tested by
no test coverage detected