47 lines
810 B
Go
47 lines
810 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
type TestInfo struct {
|
|
Id int `json:"id"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
func main() {
|
|
app := fiber.New()
|
|
|
|
app.Get("/", func(c *fiber.Ctx) error {
|
|
|
|
a := TestInfo{
|
|
Id: 1,
|
|
Name: "testing",
|
|
}
|
|
|
|
var tester []TestInfo
|
|
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
tester = append(tester, a)
|
|
|
|
return c.Status(200).JSON(tester)
|
|
})
|
|
|
|
log.Fatal(app.Listen(":3000"))
|
|
}
|