This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Config, Context, Effect, Layer, Match } from "effect"
|
||||
import type { Server } from "node:http"
|
||||
import type { AddressInfo } from "node:net"
|
||||
import { ImportError } from "../../ImportError"
|
||||
import { ExpressApp } from "./ExpressApp"
|
||||
|
||||
|
||||
@@ -9,7 +10,7 @@ export class ExpressNodeHTTPServer extends Context.Tag("ExpressNodeHTTPServer")<
|
||||
|
||||
const importNodeHTTP = Effect.tryPromise({
|
||||
try: () => import("node:http"),
|
||||
catch: cause => new Error("Could not import 'node:http'. Make sure you are using a runtime that implements Node APIs.", { cause }),
|
||||
catch: cause => new ImportError({ path: "node:http", cause }),
|
||||
})
|
||||
|
||||
const serverListeningMessage = Match.type<AddressInfo | string | null>().pipe(
|
||||
|
||||
Reference in New Issue
Block a user