1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-28 08:38:39 +02:00

Updated docs

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2015-10-05 15:52:07 -07:00
parent e45f310607
commit 1efe837fdd
17 changed files with 100 additions and 13 deletions

View File

@ -462,11 +462,13 @@ func (e *Echo) Routes() []Route {
// ServeHTTP implements `http.Handler` interface, which serves HTTP requests.
func (e *Echo) ServeHTTP(w http.ResponseWriter, r *http.Request) {
println(r.Method)
c := e.pool.Get().(*Context)
h, echo := e.router.Find(r.Method, r.URL.Path, c)
if echo != nil {
e = echo
}
println(echo)
c.reset(r, w, e)
// Chain middleware with handler in the end

17
website/Makefile Normal file
View File

@ -0,0 +1,17 @@
.PHONY: build push deploy
NAME := echo
TAG := $(shell date +'%Y.%m.%dT%H.%M')
build:
rm -rf public
hugo
gox -osarch=linux/amd64 -output server
docker build -t gcr.io/$(PROJECT_ID)/$(NAME):$(TAG) .
push: build
gcloud docker push gcr.io/$(PROJECT_ID)/$(NAME):$(TAG)
deploy: push
# https://github.com/kubernetes/kubernetes/blob/release-1.0/docs/user-guide/kubectl/kubectl_rolling-update.md
kubectl rolling-update $(NAME) --image=gcr.io/$(PROJECT_ID)/$(NAME):$(TAG)

View File

@ -3,7 +3,7 @@ title: Customization
menu:
main:
parent: guide
weight: 20
weight: 2
---
### HTTP error handler

View File

@ -3,7 +3,7 @@ title: Error Handling
menu:
main:
parent: guide
weight: 70
weight: 7
---
Echo advocates centralized HTTP error handling by returning `error` from middleware

View File

@ -3,7 +3,7 @@ title: Installation
menu:
main:
parent: guide
weight: 10
weight: 1
---
Echo has been developed and tested using Go `1.4.x`

View File

@ -3,7 +3,7 @@ title: Middleware
menu:
main:
parent: guide
weight: 40
weight: 4
---
Middleware is a function which is chained in the HTTP request-response cycle. Middleware

View File

@ -3,7 +3,7 @@ title: Request
menu:
main:
parent: guide
weight: 50
weight: 5
---
### Path parameter

View File

@ -3,7 +3,7 @@ title: Response
menu:
main:
parent: guide
weight: 60
weight: 6
---
### Template

View File

@ -3,7 +3,7 @@ title: Routing
menu:
main:
parent: guide
weight: 30
weight: 3
---
Echo's router is [fast, optimized]({{< relref "index.md#performance">}}) and

View File

@ -37,8 +37,8 @@
</div>
</div>
</div>
</main>
{{ partial "footer.html" . }}
</main>
</div>
</body>

View File

@ -16,8 +16,8 @@
</div>
</div>
</div>
</main>
{{ partial "footer.html" . }}
</main>
</div>
</body>

View File

@ -28,6 +28,7 @@
</div>
</footer>
<script src="/scripts/highlight.pack.min.js"></script>
<script src="/scripts/echo.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script>
(function(i, s, o, g, r, a, m) {

View File

@ -18,4 +18,5 @@
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/styles/monokai.css">
<link rel="stylesheet" href="/styles/echo.css">
<script src="//storage.googleapis.com/code.getmdl.io/1.0.5/material.min.js"></script>
</head>

29
website/rc.json Normal file
View File

@ -0,0 +1,29 @@
{
"apiVersion": "v1",
"kind": "ReplicationController",
"metadata": {
"name": "echo"
},
"spec": {
"replicas": 2,
"selector": {
"name": "echo"
},
"template": {
"metadata": {
"labels": {
"name": "echo"
}
},
"spec": {
"containers": [{
"image": "gcr.io/fluent-anagram-95603/echo",
"name": "echo",
"ports": [{
"containerPort": 5091
}]
}]
}
}
}
}

18
website/service.json Normal file
View File

@ -0,0 +1,18 @@
{
"apiVersion": "v1",
"kind": "Service",
"metadata": {
"name": "echo",
"labels": {
"name": "echo"
}
},
"spec": {
"ports": [{
"port": 5091
}],
"selector": {
"name": "echo"
}
}
}

View File

@ -0,0 +1,10 @@
(function() {
var menu = document.querySelectorAll('.menu a');
for (var i = 0; i < menu.length; i++) {
var m = menu[i];
if (location.href === m.href) {
m.className += 'active';
}
}
})();

View File

@ -1,5 +1,4 @@
footer {
padding: 40px 80px !important;
background-color: inherit !important;
border-top: 2px solid #E0E0E0;
}
@ -16,11 +15,13 @@ footer {
color: #333;
}
code {
font-size: .95em;
padding: 2px 4px;
background: #eee;
background: #EEE;
color: #424242;
font-size: .95em;
font-family: Source Code Pro, Monaco, Menlo, Consolas, monospace;
border: 1px solid #BDBDBD;
border-radius: 4px;
}
a:link {
text-decoration: none;
@ -36,5 +37,13 @@ a:link {
.menu a {
display: block;
color: #757575;
padding: 2px 0
padding: 5px;
border-left:2px #F06292 solid;
}
.menu a:hover {
background-color: #E0E0E0;
}
.menu .active {
color: #FFF;
background-color: #F06292;
}