关于golang:技术分享使用-iris-是根据-laravel-特色-搭建小架子

阐明: iris-framework 曾经蕴含了 jwt 、xorm、mysql、godotenv

func main() {
    newApp()
}

func newApp() {
    app := iris.New()

    app.Use(Middleware.CORS) // 跨域设置
    routes.Register(app) // 注册路由

    app.HandleDir("/upload", "public/upload") // 设置动态资源

// 启动 app
    app.Run(
        iris.Addr(":" + os.Getenv("APP_PORT")),
        iris.WithoutServerError(iris.ErrServerClosed),
        iris.WithOptimizations,
    )
}

具体详情请关注
github.com/nelsonkti/iris-framewor…

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理