diff --git a/server/assets/index.html b/server/assets/index.html
new file mode 100644
index 0000000..0a90125
--- /dev/null
+++ b/server/assets/index.html
@@ -0,0 +1 @@
+Testing
\ No newline at end of file
diff --git a/server/main.go b/server/main.go
index ca3105f..1ff6f8b 100644
--- a/server/main.go
+++ b/server/main.go
@@ -3,13 +3,27 @@ package server
import (
"github.com/labstack/echo"
"github.com/labstack/echo/engine/standard"
+ "github.com/labstack/echo/middleware"
"net/http"
)
+func render(c echo.Context, path string) error{
+ data, err := Asset(path)
+ if err != nil {
+ return echo.NewHTTPError(http.StatusNotFound)
+ }
+ rs := c.Response()
+ rs.Header().Set(echo.HeaderContentType, echo.MIMETextHTMLCharsetUTF8)
+ rs.WriteHeader(http.StatusOK)
+ rs.Write(data)
+ return nil
+}
+
func init() {
e := echo.New()
+ e.Use(middleware.Gzip())
e.GET("/", func(c echo.Context) error {
- return c.String(http.StatusOK, "Hi Realize")
+ return render(c, "server/assets/index.html")
})
go e.Run(standard.New(":5000"))
}