add routes

This commit is contained in:
Yanislav Igonin 2022-04-06 00:43:13 +03:00
parent c132512059
commit 1720c08625

14
main.go
View File

@ -114,7 +114,19 @@ func main() {
app := fiber.New() app := fiber.New()
app.Get("/", func(c *fiber.Ctx) error { app.Get("/", func(c *fiber.Ctx) error {
return c.SendString("Hello, World!") return c.SendString("get threads")
})
app.Post("/", func(c *fiber.Ctx) error {
return c.SendString("create thread")
})
app.Get("/:threadID", func(c *fiber.Ctx) error {
return c.SendString("get thread by id")
})
app.Post("/threadID", func(c *fiber.Ctx) error {
return c.SendString("create post in thread")
})
app.Get("/captcha/:captchaID", func(c *fiber.Ctx) error {
return c.SendString("get captcha by id")
}) })
log.Println("app - online, port -", strconv.Itoa(config.App.Port)) log.Println("app - online, port -", strconv.Itoa(config.App.Port))