mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
Merge pull request #673 from christiansaiki/master
Fixed Hello World example Former-commit-id: af657491abab80b36759c0bcd79a510316cbc6de
This commit is contained in:
commit
938341622c
|
@ -19,14 +19,14 @@ func main() {
|
||||||
// same as app.Handle("GET", "/ping", [...])
|
// same as app.Handle("GET", "/ping", [...])
|
||||||
// Method: GET
|
// Method: GET
|
||||||
// Resource: http://context:8080/ping
|
// Resource: http://context:8080/ping
|
||||||
app.Get("/ping", func(ctx iris.Context) {
|
app.Get("/ping", func(ctx context.Context) {
|
||||||
ctx.WriteString("pong")
|
ctx.WriteString("pong")
|
||||||
})
|
})
|
||||||
|
|
||||||
// Method: GET
|
// Method: GET
|
||||||
// Resource: http://localhost:8080/hello
|
// Resource: http://localhost:8080/hello
|
||||||
app.Get("/hello", func(ctx context.Context) {
|
app.Get("/hello", func(ctx context.Context) {
|
||||||
ctx.JSON(iris.Map{"message": "Hello iris web framework."})
|
ctx.JSON(context.Map{"message": "Hello iris web framework."})
|
||||||
})
|
})
|
||||||
|
|
||||||
// http://localhost:8080
|
// http://localhost:8080
|
||||||
|
|
Loading…
Reference in New Issue
Block a user