Files
meiseayoung 3b8d21dd0d fix: update import path to VPM package name (meiseayoung.hono)
- Change all `import hono` to `import meiseayoung.hono` in code and docs
- Ensure compatibility with VPM installation via `v install meiseayoung.hono`
2026-01-02 22:05:12 +08:00

25 lines
574 B
V

module main
import net.http
import meiseayoung.hono
fn main() {
mut app := hono.Hono.new()
app.get('/', fn (mut c hono.Context) http.Response {
return c.text('Hello from V-Hono + picoev!')
})
app.get('/json', fn (mut c hono.Context) http.Response {
return c.json('{"message": "Hello, JSON!"}')
})
app.get('/users/:id', fn (mut c hono.Context) http.Response {
user_id := c.params['id'] or { 'unknown' }
return c.json('{"user_id": "${user_id}"}')
})
// 使用默认 picoev 后端
app.listen(':3009')
}