Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 1.16 KB

README.md

File metadata and controls

57 lines (41 loc) · 1.16 KB

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 - /