Files
herolib/examples/hero/heromodels/heroserver_example.vsh
Mahmoud-Emad 386fae3421 refactor: integrate heromodels RPC with heroserver
- Integrate heromodels RPC as a handler within heroserver
- Update API endpoint to use standard JSON-RPC format
- Add generated curl examples with copy button to docs
- Improve error handling to return JSON-RPC errors
- Simplify heromodels server example script
2025-09-17 21:08:17 +03:00

18 lines
436 B
GLSL
Executable File

#!/usr/bin/env -S v -n -w -gc none -cc tcc -d use_openssl -enable-globals -no-skip-unused run
import freeflowuniverse.herolib.hero.heromodels.rpc
import freeflowuniverse.herolib.hero.heromodels
import time
fn main() {
// Start the server in a background thread
spawn fn () {
rpc.start(port: 8080) or { panic('Failed to start HeroModels server: ${err}') }
}()
// Keep the main thread alive
for {
time.sleep(time.second)
}
}