-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.go
38 lines (31 loc) · 925 Bytes
/
doc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Copyright 2014 The orujo Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
/*
Package orujo solves a common problem, which is the execution of several
middlewares per route. It has been designed to work seamlessly with the
standard net/http library. A simple hello world would look like the following
snippet:
package main
import (
"fmt"
"log"
"net/http"
"github.com/jroimartin/orujo"
)
func main() {
http.Handle("/hello", orujo.NewPipe(
http.HandlerFunc(helloHandler),
orujo.M(http.HandlerFunc(worldHandler)),
))
log.Fatal(http.ListenAndServe(":8080", nil))
}
func helloHandler(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
fmt.Fprint(w, "Hello, ")
}
func worldHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, "world")
}
*/
package orujo