mirror of
https://github.com/kataras/iris.git
synced 2026-01-09 21:15:56 +00:00
README.md: example change
Former-commit-id: 4a66a689f86e5cd93ec9001e5ca18b4f5d3923be
This commit is contained in:
@@ -34,7 +34,7 @@ func main() {
|
||||
app.Post("/upload", func(ctx iris.Context) {
|
||||
//
|
||||
// UploadFormFiles
|
||||
// uploads any number of incoming files (multiple property on the form input).
|
||||
// uploads any number of incoming files ("multiple" property on the form input).
|
||||
//
|
||||
|
||||
// second argument is totally optionally,
|
||||
|
||||
@@ -27,6 +27,7 @@ func main() {
|
||||
|
||||
// Read
|
||||
app.Post("/decode", func(ctx iris.Context) {
|
||||
// Read https://github.com/kataras/iris/blob/master/_examples/http_request/read-json/main.go as well.
|
||||
var user User
|
||||
ctx.ReadJSON(&user)
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ func (c *VisitController) Get() string {
|
||||
visits := c.Session.Increment("visits", 1)
|
||||
// write the current, updated visits.
|
||||
since := time.Now().Sub(c.StartTime).Seconds()
|
||||
return fmt.Sprintf("%d visit from my current session in %0.1f seconds of server's up-time",
|
||||
return fmt.Sprintf("%d visit(s) from my current session in %0.1f seconds of server's up-time",
|
||||
visits, since)
|
||||
}
|
||||
|
||||
|
||||
@@ -40,5 +40,5 @@ func main() {
|
||||
// http://localhost:8080
|
||||
app.StaticWeb("/", "./public")
|
||||
|
||||
app.Run(iris.Addr("localhost:8080"))
|
||||
app.Run(iris.Addr("localhost:8080"), iris.WithoutPathCorrection)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user