mirror of
https://github.com/darmiel/yaxc.git
synced 2024-11-15 12:25:19 +08:00
20 lines
432 B
Go
20 lines
432 B
Go
package server
|
|
|
|
import "github.com/gofiber/fiber/v2"
|
|
|
|
func (s *yAxCServer) Start() {
|
|
log.Info("Starting YAxC server on", s.BindAddress)
|
|
s.App = fiber.New()
|
|
|
|
// register routes
|
|
s.App.Get("/", func(ctx *fiber.Ctx) error {
|
|
return ctx.SendString(body)
|
|
})
|
|
|
|
s.App.Get("/:anywhere", s.handleGetAnywhere)
|
|
s.App.Post("/:anywhere", s.handlePostAnywhere)
|
|
|
|
if err := s.App.Listen(s.BindAddress); err != nil {
|
|
log.Critical(err)
|
|
}
|
|
}
|