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

  1. func main() {
  2. // Creates an iris application with default middleware:
  3. // Default with "debug" Logger Level.
  4. // Localization enabled on "./locales" directory
  5. // and HTML templates on "./views" or "./templates" directory.
  6. // It runs with the AccessLog on "./access.log",
  7. // Recovery (crash-free) and Request ID middleware already attached.
  8. app := iris.Default()
  9. app.Get("/someGet", getting)
  10. app.Post("/somePost", posting)
  11. app.Put("/somePut", putting)
  12. app.Delete("/someDelete", deleting)
  13. app.Patch("/somePatch", patching)
  14. app.Header("/someHead", head)
  15. app.Options("/someOptions", options)
  16. app.Listen(":8080")
  17. }