mirror of
				https://github.com/labstack/echo.git
				synced 2025-10-30 23:57:38 +02:00 
			
		
		
		
	| @@ -1,7 +1,5 @@ | ||||
| # [Echo] (https://echo.labstack.com) [](http://godoc.org/github.com/labstack/echo) [](https://raw.githubusercontent.com/labstack/echo/master/LICENSE) [](https://travis-ci.org/labstack/echo) [](https://coveralls.io/r/labstack/echo) [](https://gitter.im/labstack/echo) [](https://twitter.com/labstack) | ||||
|  | ||||
| ### Fast and unfancy HTTP server framework for Go (Golang). | ||||
|  | ||||
| ## Feature Overview | ||||
|  | ||||
| - Optimized HTTP router which smartly prioritize routes | ||||
| @@ -16,6 +14,7 @@ | ||||
| - Define your format for the logger | ||||
| - Highly customizable | ||||
| - Automatic TLS via Let’s Encrypt | ||||
| - HTTP/2 support | ||||
| - Built-in graceful shutdown | ||||
|  | ||||
| ## Performance | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| { | ||||
|   "baseurl": "https://echo.labstack.com", | ||||
|   "languageCode": "en-us", | ||||
|   "title": "Echo - Fast and unfancy HTTP server framework for Go (Golang)", | ||||
|   "title": "Echo - Fast and Unfancy Go Web Framework", | ||||
|   "canonifyurls": true, | ||||
|   "googleAnalytics": "UA-85059636-2", | ||||
|   "permalinks": { | ||||
| @@ -10,7 +10,6 @@ | ||||
|     "recipes": "/recipes/:filename" | ||||
|   }, | ||||
|   "params": { | ||||
|     "image": "https://echo.labstack.com/images/logo.png", | ||||
|     "description": "Echo is a high performance, extensible, minimalist web framework for Go (Golang)." | ||||
|   } | ||||
| } | ||||
|   | ||||
| @@ -200,9 +200,9 @@ Server any file from static directory for path `/static/*`. | ||||
| e.Static("/static", "static") | ||||
| ``` | ||||
|  | ||||
| ##### [Learn More](https://echo.labstack.com/guide/static-files) | ||||
| #### [Learn More](/guide/static-files) | ||||
|  | ||||
| ### [Template Rendering](https://echo.labstack.com/guide/templates) | ||||
| ### [Template Rendering](/guide/templates) | ||||
|  | ||||
| ### Middleware | ||||
|  | ||||
| @@ -231,3 +231,5 @@ e.GET("/users", func(c echo.Context) error { | ||||
| 	return c.String(http.StatusOK, "/users") | ||||
| }, track) | ||||
| ``` | ||||
|  | ||||
| #### [Learn More](/middleware) | ||||
|   | ||||
| @@ -7,15 +7,32 @@ description = "Installing Echo" | ||||
|   weight = 1 | ||||
| +++ | ||||
|  | ||||
| Echo is developed and tested using Go `1.6.x` and `1.7.x` | ||||
| ## Prerequisites | ||||
|  | ||||
| - [Install](https://golang.org/doc/install) Go | ||||
| - [Set](https://golang.org/doc/code.html#GOPATH) GOPATH | ||||
|  | ||||
| ## Using [go get](https://golang.org/cmd/go/#hdr-Download_and_install_packages_and_dependencies) | ||||
|  | ||||
| ```sh | ||||
| $ cd <project in $GOPATH> | ||||
| $ go get -u github.com/labstack/echo | ||||
| ``` | ||||
|  | ||||
| > Ideally you should rely on a [package manager](https://github.com/avelino/awesome-go#package-management) like glide or govendor to use a specific [version](https://github.com/labstack/echo/releases) of Echo. | ||||
| ## Using [glide](http://glide.sh) | ||||
|  | ||||
| ## [Migrating Guide](/guide/migration) | ||||
| ```sh | ||||
| $ cd <project in $GOPATH> | ||||
| $ glide get github.com/labstack/echo#~3.0 | ||||
| ``` | ||||
|  | ||||
| Echo follows [semantic versioning](http://semver.org) managed through GitHub releases. | ||||
| Specific version of Echo can be installed using a [package manager](https://github.com/avelino/awesome-go#package-management). | ||||
| ## Using [govendor](https://github.com/kardianos/govendor) | ||||
|  | ||||
| ```sh | ||||
| $ cd <project in $GOPATH> | ||||
| $ govendor fetch github.com/labstack/echo@v3.0 | ||||
| ``` | ||||
|  | ||||
| Echo is developed using Go `1.7.x` and tested with Go `1.6.x` and `1.7.x`. | ||||
| Echo follows [semantic versioning](http://semver.org) managed through GitHub | ||||
| releases, specific version of Echo can be installed using a [package manager](https://github.com/avelino/awesome-go#package-management). | ||||
|   | ||||
| @@ -156,4 +156,4 @@ req, err := http.NewRequest(echo.POST, "/?"+q.Encode(), nil) | ||||
|  | ||||
| *TBD* | ||||
|  | ||||
| You can looking to built-in middleware [test cases](https://github.com/labstack/echo/tree/master/middleware). | ||||
| For now you can look into built-in middleware [test cases](https://github.com/labstack/echo/tree/master/middleware). | ||||
|   | ||||
| @@ -7,7 +7,7 @@ description = "Redirect middleware for Echo" | ||||
|   weight = 5 | ||||
| +++ | ||||
|  | ||||
| ## HTTPSRedirect Middleware | ||||
| ## HTTPSRedirect | ||||
|  | ||||
| HTTPSRedirect middleware redirects http requests to https. | ||||
| For example, http://labstack.com will be redirected to https://labstack.com. | ||||
| @@ -19,7 +19,7 @@ e := echo.New() | ||||
| e.Pre(middleware.HTTPSRedirect()) | ||||
| ``` | ||||
|  | ||||
| ## HTTPSWWWRedirect Middleware | ||||
| ## HTTPSWWWRedirect | ||||
|  | ||||
| HTTPSWWWRedirect redirects http requests to www https. | ||||
| For example, http://labstack.com will be redirected to https://www.labstack.com. | ||||
| @@ -31,7 +31,7 @@ e := echo.New() | ||||
| e.Pre(middleware.HTTPSWWWRedirect()) | ||||
| ``` | ||||
|  | ||||
| ## HTTPSNonWWWRedirect Middleware | ||||
| ## HTTPSNonWWWRedirect | ||||
|  | ||||
| HTTPSNonWWWRedirect redirects http requests to https non www. | ||||
| For example, http://www.labstack.com will be redirect to https://labstack.com. | ||||
| @@ -43,7 +43,7 @@ e := echo.New() | ||||
| e.Pre(middleware.HTTPSNonWWWRedirect()) | ||||
| ``` | ||||
|  | ||||
| ## WWWRedirect Middleware | ||||
| ## WWWRedirect | ||||
|  | ||||
| WWWRedirect redirects non www requests to www. | ||||
|  | ||||
| @@ -56,7 +56,7 @@ e := echo.New() | ||||
| e.Pre(middleware.WWWRedirect()) | ||||
| ``` | ||||
|  | ||||
| ## NonWWWRedirect Middleware | ||||
| ## NonWWWRedirect | ||||
|  | ||||
| NonWWWRedirect redirects www requests to non www. | ||||
| For example, http://www.labstack.com will be redirected to http://labstack.com. | ||||
|   | ||||
| @@ -1,27 +1,44 @@ | ||||
| h1 = "Echo" | ||||
| h2 = "High performance, extensible, minimalist web framework for Go" | ||||
| heading = "Echo" | ||||
| description = "High performance, extensible, minimalist Go web framework" | ||||
| [[features]] | ||||
|   icon = "rocket" | ||||
|   title = "Optimized Router" | ||||
|   text = "Highly optimized HTTP router which smartly prioritize routes" | ||||
|   text = """ | ||||
|     Highly optimized HTTP router with zero dynamic memory allocation which smartly | ||||
|     prioritize routes. | ||||
|   """ | ||||
| [[features]] | ||||
|   icon = "cloud" | ||||
|   title = "RESTful API" | ||||
|   text = "Build robust and scalable RESTful API" | ||||
|   title = "Scalable" | ||||
|   text = "Build robust and scalable RESTful API, easily organized into groups." | ||||
| [[features]] | ||||
|   icon = "license" | ||||
|   title = "Automatic TLS" | ||||
|   text = "Automatically install TLS certificates from Let's Encrypt" | ||||
|   text = "Automatically install TLS certificates from Let's Encrypt." | ||||
| [[features]] | ||||
|   icon = "funnel" | ||||
|   title = "Middleware Levels" | ||||
|   text = "Define middleware at root, group or route level" | ||||
|   title = "Middleware" | ||||
|   text = """ | ||||
|     Many built-in middleware to use, or define your own. Middleware can be set at root, | ||||
|     group or route level. | ||||
|   """ | ||||
| [[features]] | ||||
|   icon = "sync" | ||||
|   icon = "database_upload" | ||||
|   title = "Data Binding" | ||||
|   text = "Data binding for JSON, XML and form payload" | ||||
|   text = "Data binding for HTTP request payload, including JSON, XML or form-data." | ||||
| [[features]] | ||||
|   icon = "database_download" | ||||
|   title = "Data Rendering" | ||||
|   text = """ | ||||
|     API to send variety of HTTP response, including JSON, XML, HTML, File, Attachment, | ||||
|     Inline, Stream or Blob. | ||||
|   """ | ||||
| [[features]] | ||||
|   icon = "code" | ||||
|   title = "Templates" | ||||
|   text = "Template rendering with any template engine" | ||||
|   text = "Template rendering using any template engine." | ||||
| [[features]] | ||||
|   icon = "equalizer" | ||||
|   title = "Extensible" | ||||
|   text = "Customized central HTTP error handling. Easily extendable API." | ||||
|  | ||||
|   | ||||
| @@ -9,8 +9,8 @@ | ||||
| 	  <div class="w3-row-padding"> | ||||
| 			<div class="w3-col m10 l10"> | ||||
|         <div class="hero"> | ||||
|           <h1>{{ .Site.Data.index.h1 }}</h1> | ||||
|           <h2>{{ .Site.Data.index.h2 }}</h2> | ||||
|           <h1 class="heading">{{ .Site.Data.index.heading }}</h1> | ||||
|           <h2 class="description">{{ .Site.Data.index.description }}</h2> | ||||
|           <p> | ||||
|             <img style="width: 100%;" src="/images/echo_terminal.png" alt="Echo"> | ||||
|           </p> | ||||
|   | ||||
| @@ -3,18 +3,18 @@ | ||||
| <head> | ||||
|   <meta charset="utf-8"> | ||||
|   <meta http-equiv="x-ua-compatible" content="ie=edge"> | ||||
|   <meta name="description" content="{{ if ne .URL "/" }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}"> | ||||
|   <meta name="description" content="{{ if ne .URL "/" }}{{ .Description }} | {{ end }}{{ .Site.Params.description }}"> | ||||
|   <meta name="viewport" content="width=device-width, initial-scale=1"> | ||||
|   <meta name="twitter:card" content="summary"> | ||||
|   <meta name="twitter:site" content="@echo"> | ||||
|   <meta name="twitter:title" content="{{ if ne .URL "/" }}{{ .Title }} | {{ end }}{{ .Site.Title }}"> | ||||
|   <meta name="twitter:description" content="{{ if ne .URL "/" }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}"> | ||||
|   <meta name="twitter:image" content="{{ .Site.Params.image }}"> | ||||
|   <meta name="twitter:description" content="{{ if ne .URL "/" }}{{ .Description }} | {{ end }}{{ .Site.Params.description }}"> | ||||
|   <meta name="twitter:image" content="{{ .Site.BaseURL }}/images/logo.png"> | ||||
|   <meta property="og:title" content="{{ if ne .URL "/" }}{{ .Title }} | {{ end }}{{ .Site.Title }}"> | ||||
|   <meta property="og:site_name" content="echo"> | ||||
|   <meta property="og:description" content="{{ if ne .URL "/" }}{{ .Description }}{{ else }}{{ .Site.Params.description }}{{ end }}"> | ||||
|   <meta property="og:description" content="{{ if ne .URL "/" }}{{ .Description }} | {{ end }}{{ .Site.Params.description }}"> | ||||
|   <meta property="og:url" content="{{ .Site.BaseURL }}"> | ||||
|   <meta property="og:image" content="{{ .Site.Params.image }}"> | ||||
|   <meta property="og:image" content="{{ .Site.BaseURL }}/images/logo.png"> | ||||
|   <title> | ||||
|     {{ if ne .URL "/" }}{{ .Title }} | {{ end }}{{ .Site.Title }} | ||||
|   </title> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user