Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 8098ab5

Browse files
committed
update encore go example
1 parent c26e224 commit 8098ab5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/pages/concepts/comparison/encore.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ package main
2222
import (
2323
"fmt"
2424

25-
"github.com/nitrictech/go-sdk/faas"
25+
"github.com/nitrictech/go-sdk/nitric/apis"
2626
"github.com/nitrictech/go-sdk/nitric"
2727
)
2828

@@ -33,12 +33,10 @@ func main() {
3333
return
3434
}
3535

36-
mainApi.Get("/hello/:name", func(ctx *faas.HttpContext, next faas.HttpHandler) (*faas.HttpContext, error) {
36+
mainApi.Get("/hello/:name", func(ctx *apis.Ctx) {
3737
params := ctx.Request.PathParams()
3838

3939
ctx.Response.Body = []byte("Hello " + params["name"])
40-
41-
return next(ctx)
4240
})
4341

4442
if err := nitric.Run(); err != nil {
@@ -74,7 +72,7 @@ The Nitric example shows an API where HTTP request handling is achieved using `f
7472
| | Nitric | Encore |
7573
| -------------------- | -------------------------------------------------------------------------------------------- | -------------------------- |
7674
| Language | Your choice | Go |
77-
| Lines of code | 27 | 15 |
75+
| Lines of code | 26 | 15 |
7876
| Cloud Infrastructure | Inferred | Inferred |
7977
| Extensibility | [Custom providers](/reference/providers/custom/building-custom-provider) can be created | No |
8078
| Local simulation | Built-in local simulator | Built-in local simulator |

0 commit comments

Comments
 (0)