Is there a way to have some kind of initialization function that runs server side and stays server side? #2408
Unanswered
empath-nirvana
asked this question in
Q&A
Replies: 1 comment
-
You can put code in your main function under the fn main() {
server! {
println!("This runs on the server");
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I want to create a kubernetes client once on startup and then use that for all the api calls later, but I can't figure out how to have a function that starts up and creates some global state that lives on the server that other server functions can access without them also running in the client.
The reason why is the kubernetes libraries require tokio/mio and won't run client side, so I need everything to stay on the server.
Beta Was this translation helpful? Give feedback.
All reactions