Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
title layout
Hono Github Issue 3242

@hono/github/issue-3242

https://github.com/honojs/hono/issue/3242

Contents

Solution

Please check https://github.com/honojs/hono/issue/3242#issuecomment-2275418065 of solution being provided.

Not working

app.get("*", serveStatic({ root: "./public" }));
app.get("*", serveStatic({ path: "./public/index.html" })); // fallback

Working

app.get(
  "*",
  serveStatic({
    root: `${relative(process.cwd(), __dirname)}/../client/dist/`,
  }),
);
app.get(
  "*",
  serveStatic({
    path: `${relative(process.cwd(), __dirname)}/client/dist/index.html`,
  }),
); // fallback

Setup

To clone:

git clone https://github.com/rjoydip/oss-issue-fix-collection.git
cd oss-issue-fix-collection/honojs/hono/github/3242

To install dependencies:

bun install

To run:

bun run dev

open http://localhost:3000/index.html

To test:

bun test