This commit is contained in:
2025-09-19 05:35:59 +02:00
parent f54c57847a
commit 1709618f2c
9 changed files with 74 additions and 27 deletions

View File

@@ -8,9 +8,10 @@ fn main() {
// Start the server in a background thread with authentication disabled for testing
spawn fn () {
rpc.start(
port: 8080
port: 8086
auth_enabled: false // Disable auth for testing
cors_enabled: true
reset: true
allowed_origins: [
'http://localhost:5173',
]

View File

@@ -5,7 +5,7 @@ import freeflowuniverse.herolib.schemas.openrpc
import os
// 1. Create a new server instance
mut server := heroserver.new(port: 8080)!
mut server := heroserver.new(port: 8086)!
// 2. Create and register your OpenRPC handlers
// These handlers must conform to the `openrpc.OpenRPCHandler` interface.
@@ -14,8 +14,8 @@ openrpc_path := os.join_path(script_dir, 'openrpc.json')
handler := openrpc.new_handler(openrpc_path)!
server.register_handler('comments', handler)!
println('Server starting on http://localhost:8080')
println('Documentation available at: http://localhost:8080/doc/comments/')
println('Comments API available at: http://localhost:8080/api/comments')
println('Server starting on http://localhost:8086')
println('Documentation available at: http://localhost:8086/doc/comments/')
println('Comments API available at: http://localhost:8086/api/comments')
server.start()!