- Use `json2.decode[json2.Any]` instead of `json2.raw_decode` - Add `@[required]` to procedure function signatures - Improve error handling for missing JSONRPC fields - Update `encode` to use `prettify: true` - Add checks for missing schema and content descriptor references
33 lines
774 B
GLSL
Executable File
33 lines
774 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 incubaid.herolib.hero.heromodels
|
|
import time
|
|
|
|
fn main() {
|
|
// Start the server in a background thread with authentication disabled for testing
|
|
spawn fn () {
|
|
heromodels.new(reset: true, name: 'test') or {
|
|
eprintln('Failed to initialize HeroModels: ${err}')
|
|
exit(1)
|
|
}
|
|
heromodels.server_start(
|
|
name: 'test'
|
|
port: 8080
|
|
auth_enabled: false // Disable auth for testing
|
|
cors_enabled: true
|
|
reset: true
|
|
allowed_origins: [
|
|
'http://localhost:5173',
|
|
]
|
|
) or {
|
|
eprintln('Failed to start HeroModels server: ${err}')
|
|
exit(1)
|
|
}
|
|
}()
|
|
|
|
// Keep the main thread alive
|
|
for {
|
|
time.sleep(time.second)
|
|
}
|
|
}
|