Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add static serve to templates #56

Merged
merged 1 commit into from
Mar 3, 2024
Merged

feat: add static serve to templates #56

merged 1 commit into from
Mar 3, 2024

Conversation

jxom
Copy link
Member

@jxom jxom commented Mar 3, 2024

No description provided.

Copy link

vercel bot commented Mar 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
frog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 3, 2024 0:50am
frog-auth ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 3, 2024 0:50am
frog-frame ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 3, 2024 0:50am

})
console.log('Server is running on port 3000')
if (typeof Bun !== 'undefined') {
app.use('/*', (await import('hono/bun')).serveStatic({ root: './public' }))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to dynamically import as hono/bun internally uses the Bun glob.

@@ -55,4 +56,13 @@ app.frame('/', (c) => {
})
})

if (import.meta.env?.MODE !== 'development')
Copy link
Member Author

@jxom jxom Mar 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vite cannot resolve Cloudflare's __STATIC_CONTENT_MANIFEST. Could probably set up a virtual module, but not sure if worth.

@jxom jxom marked this pull request as ready for review March 3, 2024 00:56
@jxom jxom merged commit 1ca14fc into main Mar 3, 2024
12 checks passed
@jxom jxom deleted the serve-static branch March 3, 2024 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant