Skip to content

zerolethanh/frlog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frlog

fiber routes log

Install

go get github.com/zerolethanh/frlog

Usage

package main

import (
	"github.com/gofiber/fiber/v2"
	"github.com/zerolethanh/frlog"
	"log"
)

func main() {
	app := fiber.New()
	app.Get("/", func(c *fiber.Ctx) error {
		return c.SendString("Hello, World!")
	})
	app.Post("/login", func(c *fiber.Ctx) error {
		return c.SendString("Login")
	})
	app.Put("/login/:uid", func(c *fiber.Ctx) error {
		return c.SendString("Login")
	})
	app.Get("/user/:id", func(c *fiber.Ctx) error {
		return c.SendString("User")
	})
	app.Patch("/fly/:from-:to", func(c *fiber.Ctx) error {
		return c.SendString("Fly")
	})

	frlog.PrintAppStacks(app)

	log.Fatalln(app.Listen(":3000"))
}

Output:

Ảnh màn hình 2022-11-16 lúc 14 22 08

LICENSE

MIT