/gee

Gee API Framework is a Web framework that encapsulates net/http. It is different from the Gin framework. It does not encapsulate the template. It is only applicable to the backend and does not consider compatibility with the template. However, it can be used like Gin.

Primary LanguageGoMIT LicenseMIT

logo

Gee API Framework

Gee API Framework encapsulates the net/http framework, making it easier and faster for us to write backend APIs

Gee has the following characteristics

  • Fast
  • Zero allocation router
  • Middleware support
  • Routes grouping
  • Extendable

Get Started

Prerequisites

  • Go: any one of the three latest major releases (we test it with these).

Getting Gee

import "github.com/gitlayzer/gee"

to your code, and then go [build|run|test] will automatically fetch the necessary dependencies.

Otherwise, run the following Go command to install the gee package:

$ go get -u github.com/gitlayzer/gee

Running Gee

First you need to import Gee package for using Gee, one simplest example likes the follow main.go:

package main

import gee "github.com/gitlayzer/gee_api_framework"

func main() {
	r := gee.Default()

	r.GET("/", func(c *gee.Context) {
		c.JSON(200, gee.H{
			"message": "Hello Gee",
		})
	})

	_ = r.Run(":8888")
}

And use the Go command to run the demo:

❯ go run .\main.go
2024/03/24 17:23:12 [Gee]  GET - /