Skip to content

gota33/initializr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

go get -u github.com/gota33/initializr

Example

package main

import (
	"log"

	"github.com/gofiber/fiber/v2"
	"github.com/gota33/initializr"
	fiber2 "github.com/gota33/initializr/fiber/v2"
)

func main() {
	ctx, cancel := initializr.GracefulContext()
	defer cancel()

	server, listen, shutdown := fiber2.New(":8080")

	server.Get("hello", func(c *fiber.Ctx) error {
		return c.SendString("Hello")
	})

	if err := initializr.Run(ctx, listen, shutdown); err != nil {
		log.Fatalf("Exit with error: %v", err)
	}
}