Comments (2)
@staniboy You can check #3108 (comment) and PR #3108, honojs/node-server#78
For workaround, you can do something like below
// for client
app.get("*", serveStatic({ root: `${relative(process.cwd(), __dirname)}/../client/dist/` }));
app.get("*", serveStatic({ path: `${relative(process.cwd(), __dirname)}/client/dist/index.html` })); // fallback
// for public
app.get("*", serveStatic({ root: `${relative(process.cwd(), __dirname)}/public/` }));
app.get("*", serveStatic({ path: `${relative(process.cwd(), __dirname)}/public/index.html` })); // fallback
If you use ES modules then instead of using __dirname
you can use import.meta.dirname
Duplicate #2200
from hono.
Regarding this problem, it's not an actual bug, but we have to consider to solve it.
from hono.
Related Issues (20)
- Types not available on Deno with Hono v4.5.5 HOT 2
- MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. HOT 2
- jsx/dom documentation doesn't provide enough info for working example HOT 5
- Using c.req.formData(), bodyLimit and original middleware, it's loading all the time HOT 2
- `trimTrailingSlash` doesn't work for `POST`, `PATCH`, `DELETE` request HOT 3
- ReferenceError: global is not defined HOT 5
- Flat Routing with Regex Not Working HOT 2
- [Feature Request]: Automatic Port Switching for Local Development Servers HOT 8
- Types: LambdaEvent type is missing authorizer context for lambda auth HOT 1
- Pusher and honojs Crypto error Nextjs HOT 2
- Types exports are incorrect in package.json HOT 3
- Validator: FormData validation fails when content-type header does not have a space
- Stop using `any` HOT 2
- Support for Express.js Compatible Middleware HOT 3
- `hono/validator` cannot validate if charset is included in the Content-Type of URL Encoded Data
- Body is not forwarded HOT 4
- RPC client doesn't handle optional path parameters HOT 2
- RPC support for SSE HOT 3
- Interface 'ClientResponse<T, U, F>' incorrectly extends interface 'Response'. HOT 2
- Return a piped response with compression enabled causes an unexpected error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hono.