MCPcopy Create free account
hub / github.com/Effect-TS/effect / onSuccess

Function onSuccess

packages/effect/src/unstable/http/HttpStaticServer.ts:191–199  ·  view source on GitHub ↗
(info)

Source from the content-addressed store, hash-verified

189 ? Effect.fail(toRouteNotFoundError(request))
190 : Effect.fail(toInternalServerError(request, error)),
191 onSuccess(info) {
192 if (info.type === "File") {
193 return serveFile(request, resolvedPath, Number(info.size))
194 }
195 if (info.type === "Directory" && index !== undefined) {
196 return serveFile(request, path.join(resolvedPath, index))
197 }
198 return Effect.fail(toRouteNotFoundError(request))
199 }
200 })
201 })
202})

Callers

nothing calls this directly

Calls 4

toRouteNotFoundErrorFunction · 0.85
joinMethod · 0.80
NumberInterface · 0.50
failMethod · 0.45

Tested by

no test coverage detected