/nrg

This is a high-performance Golang web routing framework

Primary LanguageGo

NRG

nrg(Ni9ht Router Group) is a simple and easy to use router for your web application. It is written in pure Golang and has no dependencies.

Features

  • HTTP Methods
    • add http handler
  • Context
    • GetQuery
    • PostFrom
    • GetBody
    • GetHeader
    • Get
    • JSON
    • HTML
    • File
  • Redirect
  • Router
    • Add Router
    • Static Route
    • Parameter Route
    • Regex Route
    • Group Route
  • Middleware

Quick Start

  1. Installation
go get -u github.com/yni9ht/nrg
  1. Example
package main

import (
  "fmt"
  "github.com/yni9ht/nrg"
)

func main() {
  server := nrg.NewServer()

  server.GET("/ping", func(context *nrg.Context) {
    context.JSON(200, "pong")
  })

  if err := server.Run(); err != nil {
    fmt.Printf("error %+v \n", err)
  }
}