Skip to content

Commit

Permalink
Fix styles
Browse files Browse the repository at this point in the history
  • Loading branch information
cslzchen committed Nov 6, 2018
1 parent 8241a0b commit 9f4de58
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
21 changes: 11 additions & 10 deletions fakecas.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"database/sql"
"flag"
"fmt"
"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
_ "github.com/lib/pq"
"html/template"
"os"

"github.com/labstack/echo"
"github.com/labstack/echo/middleware"
_ "github.com/lib/pq"
)

var Version string
Expand All @@ -31,20 +32,20 @@ func main() {
}))
e.Use(middleware.Recover())

e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
e.Use(middleware.CORSWithConfig(middleware.CORSConfig{
AllowCredentials: true,
AllowOrigins: []string{"*"},
AllowMethods: []string{"GET", "PUT", "POST", "DELETE"},
AllowHeaders: []string{"Range", "Content-Type", "Authorization", "X-Requested-With"},
ExposeHeaders: []string{"Range", "Content-Type", "Authorization", "X-Requested-With"},
AllowOrigins: []string{"*"},
AllowMethods: []string{"GET", "PUT", "POST", "DELETE"},
AllowHeaders: []string{"Range", "Content-Type", "Authorization", "X-Requested-With"},
ExposeHeaders: []string{"Range", "Content-Type", "Authorization", "X-Requested-With"},
}))

t, err := template.New("login").Parse(LOGINPAGE)
if err != nil {
panic(err)
}
temp := &Template{templates: t}
e.Renderer = temp
e.Renderer = temp

e.GET("/login", LoginGET)
e.POST("/login", LoginPOST)
Expand All @@ -62,5 +63,5 @@ func main() {

defer DatabaseConnection.Close()

e.Start(*Host)
e.Start(*Host)
}
3 changes: 2 additions & 1 deletion utils.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package main

import (
"github.com/labstack/echo"
"io"
"net/url"

"github.com/labstack/echo"
)

func ValidateService(c echo.Context) *url.URL {
Expand Down
3 changes: 2 additions & 1 deletion views.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package main
import (
"database/sql"
"fmt"
"github.com/labstack/echo"
"net/http"
"net/url"
"strings"

"github.com/labstack/echo"
)

func LoginPOST(c echo.Context) error {
Expand Down

0 comments on commit 9f4de58

Please sign in to comment.