-
I'm trying to serve files built by Astro along with their imports. Currently only the html files without imports get served. For example, Here's my project structure:
And here's the code from import "./setup"
import { Hono } from "hono"
import { serveStatic } from "hono/bun"
import errorHandler from "./functions/errorHandler"
import api from "./routes/api"
const app = new Hono({ strict: true })
app
.use("/*", serveStatic({ root: "../../client/dist/" }))
.get("/", serveStatic({ path: "/index.html" }))
app.route("/api", api)
// Error
app.onError(errorHandler)
export type AppT = typeof app
export default app Please ask me to share any other info you need to help. Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
Lippiece
May 2, 2024
Replies: 1 comment
-
Resolved by moving the dist folder to the server's folder and using this: ...
app.use("/*", serveStatic({ root: "dist/" }))
... |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Lippiece
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Resolved by moving the dist folder to the server's folder and using this: