Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ func (r *routes) Routes(registry *web.RouterRegistry) {
registry.MustRoute("/hello", "hello")

// Bind the controller.Action to the handle "hello":
registry.HandleGet("hello", r.helloController.Hello)
registry.HandleGet("hello", r.helloController.Get)
}
```

Expand Down Expand Up @@ -351,7 +351,7 @@ func (r *routes) Routes(registry *web.RouterRegistry) {
registry.MustRoute("/hello", "hello")

// Bind the controller.Action to the handle "hello":
registry.HandleGet("hello", r.helloController.Hello)
registry.HandleGet("hello", r.helloController.Get)

// Bind a route with a path parameter
registry.MustRoute("/greet/:nickname", "helloWorld.greet")
Expand Down Expand Up @@ -385,6 +385,9 @@ Therfore you need to add the following action method to your controller:

// ApiHello is a controller action that renders Data
func (controller *HelloController) ApiHello(_ context.Context, r *web.Request) web.Result {

nickname, _ := r.Params["nickname"]

// Calling the Render method from the response helper and render the template "hello"
return controller.responder.Data(struct {
Nickname string
Expand All @@ -399,7 +402,7 @@ As you can see in this action, the responder's "Data" method is used to return t
The related route also need to be registered like this (inside your RouteModule):

```go
registry.MustRoute("/api", "helloWorld.api")
registry.MustRoute("/api:nickname", "helloWorld.api")
registry.HandleGet("helloWorld.api", r.helloController.ApiHello)
```

Expand Down Expand Up @@ -442,8 +445,9 @@ So lets add some typical modules to the application bootstrap:
package main

import (
"FlamingoExample/src/helloworld"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be a wrong path


"flamingo.me/dingo"
"flamingo.me/example-helloworld/src/helloworld"
"flamingo.me/flamingo/v3"
"flamingo.me/flamingo/v3/core/gotemplate"
"flamingo.me/flamingo/v3/core/healthcheck"
Expand Down