goa-go / router

Router middleware for goa, based on httprouter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

goa-router

Router middleware for goa.

Build Status Codecov Go Doc Go Report

  • Based on httprouter
  • Multiple route middleware
  • Named URL parameters
  • Support for 405 Method Not Allowed
  • Responds to OPTIONS requests with matching methods

Installation

go get -u github.com/goa-go/goa 

Example

package main

import (
  ...

  "github.com/goa-go/goa"
  "github.com/goa-go/router"
)

func main() {
  app := goa.New()
  router := router.New()
  router.GET("/", func(c *goa.Context) {
    c.String("Hello Goa!")
  })
  ...

  app.Use(router.Routes())
  ...
}

License

MIT

About

Router middleware for goa, based on httprouter.

License:MIT License


Languages

Language:Go 100.0%