Skip to content

Latest commit

 

History

History
51 lines (44 loc) · 854 Bytes

README.md

File metadata and controls

51 lines (44 loc) · 854 Bytes

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)
  }
}