烂翻译系列之Iris——API示例之使用 GET, POST, PUT, PATCH, DELETE and OPTIONS

Using GET, POST, PUT, PATCH, DELETE and OPTIONS

使用 GET, POST, PUT, PATCH, DELETE and OPTIONS

func main() {
    // Creates an iris application with default middleware:
    // Default with "debug" Logger Level.
    // Localization enabled on "./locales" directory
    // and HTML templates on "./views" or "./templates" directory.
    // It runs with the AccessLog on "./access.log",
    // Recovery (crash-free) and Request ID middleware already attached.
    app := iris.Default()

    app.Get("/someGet", getting)
    app.Post("/somePost", posting)
    app.Put("/somePut", putting)
    app.Delete("/someDelete", deleting)
    app.Patch("/somePatch", patching)
    app.Header("/someHead", head)
    app.Options("/someOptions", options)

    app.Listen(":8080")
}

 

posted @ 2021-12-13 16:05  菜鸟吊思  阅读(93)  评论(0)    收藏  举报