chore: change new_hono to Hono.new
This commit is contained in:
@@ -37,7 +37,7 @@ import hono
|
||||
import net.http
|
||||
|
||||
fn main() {
|
||||
mut app := hono.new_hono()
|
||||
mut app := hono.Hono.new()
|
||||
|
||||
// 基本路由
|
||||
app.get('/', fn (mut c hono.Context) http.Response {
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.http
|
||||
import hono
|
||||
|
||||
fn main() {
|
||||
mut app := hono.new_hono()
|
||||
mut app := hono.Hono.new()
|
||||
|
||||
// 日志中间件
|
||||
app.use(fn (mut c hono.Context, next fn (mut hono.Context) http.Response) http.Response {
|
||||
|
||||
+1
-1
@@ -167,7 +167,7 @@ fn get_content_type(file_path string) string {
|
||||
```v
|
||||
import hono
|
||||
|
||||
mut app := hono.new_hono()
|
||||
mut app := hono.Hono.new()
|
||||
|
||||
// 使用默认配置
|
||||
app.use(hono.serve_static_default())
|
||||
|
||||
+1
-1
@@ -210,7 +210,7 @@ pub fn (mut app Hono) clear_cache() {
|
||||
app.context_hybrid_router.clear_cache()
|
||||
}
|
||||
|
||||
pub fn new_hono() Hono {
|
||||
pub fn Hono.new() Hono {
|
||||
return Hono{
|
||||
server: http.Server{}
|
||||
routes: map[string]Hono{}
|
||||
|
||||
@@ -8,7 +8,7 @@ fn main() {
|
||||
println('=== 混合路由性能测试 ===')
|
||||
|
||||
// 创建应用实例
|
||||
mut app := hono.new_hono()
|
||||
mut app := hono.Hono.new()
|
||||
|
||||
// 添加静态路由
|
||||
app.get('/api/users', fn (mut c hono.Context) http.Response {
|
||||
|
||||
Reference in New Issue
Block a user