Created
October 25, 2016 13:03
-
-
Save p4tin/a908a186fa20176878bfe57bbdf86270 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"time" | |
"net/http" | |
"github.com/labstack/echo" | |
"github.com/labstack/echo/engine/fasthttp" | |
) | |
func main() { | |
echo := echo.New() | |
echo.GET("/", func(c echo.Context) error { | |
//log.Println("Request GET '/'") | |
res := []string{"Hello", "World"} | |
return c.JSON(http.StatusOK, res) | |
}) | |
fasthttp_engine := fasthttp.New(":8080") | |
fasthttp_engine.ReadTimeout = 2 * time.Second | |
fasthttp_engine.WriteTimeout = 2 * time.Second | |
log.Println("Starting Server on Port :8080") | |
log.Fatal(echo.Run(fasthttp_engine)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment