10000 GitHub - flrdv/indigo at client
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

flrdv/indigo

 
 

Repository files navigation

This is just a logo

Indigo is non-idiomatic, but focusing on simplicity and performance web-server

It provides such features:

  • Streaming-based body processing
  • Server-wide settings
  • Response object constructor
  • Middlewares
  • Endpoint groups
  • Connection hijacking

Hello, world!

package main

import (
  "log"
  
  "github.com/indigo-web/indigo"
  "github.com/indigo-web/indigo/http"
  "github.com/indigo-web/indigo/router/inbuilt"
)

const addr = "0.0.0.0:9090"

func MyHandler(request *http.Request) http.Response {
  return request.Respond().WithBody("Hello, world!")
}

func main() {
  router := inbuilt.New()
  router.Resource("/").
    Get(MyHandler).
    Post(MyHandler)

  app := indigo.NewApp(addr)
  if err := app.Serve(router); err != nil {
    log.Fatal(err)
  }
}

More examples in examples/ folder.

Project workspace (TODO list included): trello.com/w/indigowebserver

About

Indigo is a blazingly fast web-framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.9%
  • HTML 0.1%
0