Skip to content

Bun: full-stack dev server with static options is not working #4448

@foreleven

Description

@foreleven

What version of Effect is running?

"@effect/platform": "^0.76.0"
"@effect/platform-bun": "^0.56.0"

What steps can reproduce the bug?

The full-stack dev server in Bun is not functioning correctly when using the static option in BunHttpServer.layer.

const ServerLive = BunHttpServer.layer({
  static: {
    "/": homepage,
  },
  development: true,
});

const HttpLive = HttpRouter.empty.pipe(
  HttpServer.serve(HttpMiddleware.logger),
  HttpServer.withLogAddress,
  Layer.provide(ServerLive)
);

BunRuntime.runMain(Layer.launch(HttpLive));

What is the expected behavior?

Serve the homepage HTML when accessing http://localhost:3000/

What do you see instead?

Got 404.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingplatform

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions