Skip to content

Commit

Permalink
Adding new frameworks: Poteto (go-lang) (#8002)
Browse files Browse the repository at this point in the history
* ADD golang framework -> poteto

* FIX: version

* deal with change request
  • Loading branch information
poteto0 authored Nov 29, 2024
1 parent 2c66483 commit 65a1ad6
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go/poteto/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework:
website: github.com/poteto0/poteto
version: 0.23
3 changes: 3 additions & 0 deletions go/poteto/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module main

require github.com/poteto0/poteto v0.23.3
31 changes: 31 additions & 0 deletions go/poteto/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package main

import (
"github.com/poteto0/poteto"
)

func main() {
option := poteto.PotetoOption{
WithRequestId: false,
ListenerNetwork: "tcp",
}
p := poteto.NewWithOption(option)

p.GET("/", func(ctx poteto.Context) error {
_, err := ctx.GetResponse().Write([]byte(""))
return err
})

p.GET("/user/:id", func(ctx poteto.Context) error {
id, _ := ctx.PathParam("id")
_, err := ctx.GetResponse().Write([]byte(id))
return err
})

p.POST("/user", func(ctx poteto.Context) error {
_, err := ctx.GetResponse().Write([]byte(""))
return err
})

p.Run(":3000")
}

0 comments on commit 65a1ad6

Please sign in to comment.