Skip to content

Is there way to Create Database and Tables on startup? #2437

Answered by NicoPlyley
MohsinDev369 asked this question in Q&A
Discussion options

You must be logged in to vote

Hono is only a router not the server, so it does not have control of those lifecycles methods like python frameworks do. This would depend on the runtime. For example in Bun you can import the Hono instance and put it in a fetch. From there you can access the startup and exit and run functions before each. You can even control if this would rerun every time the code is hot reloaded.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@MohsinDev369
Comment options

@marcosrjjunior
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by MohsinDev369
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants