Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
ybkuroki committed Feb 20, 2021
1 parent 91942fd commit fc25f65
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
6 changes: 0 additions & 6 deletions controller/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package controller

import (
"net/http"
"regexp"

"github.com/labstack/echo/v4"
"github.com/ybkuroki/go-webapp-sample/mycontext"
Expand All @@ -27,14 +26,9 @@ func NewErrorController(context mycontext.Context) *ErrorController {
// JSONError is cumstomize error handler
func (controller *ErrorController) JSONError(err error, c echo.Context) {
logger := controller.context.GetLogger()
conf := controller.context.GetConfig()
code := http.StatusInternalServerError
msg := http.StatusText(code)

// If a request path is resource path (not api request), redirect to the root path.
if !regexp.MustCompile(conf.Security.AuthPath[0]).Match([]byte(c.Path())) {
c.Redirect(http.StatusMovedPermanently, "/")
}
if he, ok := err.(*echo.HTTPError); ok {
code = he.Code
msg = he.Message.(string)
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="/favicon.ico"><![endif]--><title>vuejs-webapp-sample</title><link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"><link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons"><link href="/css/app.750b60b0.css" rel="preload" as="style"><link href="/css/chunk-vendors.496dd37e.css" rel="preload" as="style"><link href="/js/app.d4d470cd.js" rel="preload" as="script"><link href="/js/chunk-vendors.575d9f70.js" rel="preload" as="script"><link href="/css/chunk-vendors.496dd37e.css" rel="stylesheet"><link href="/css/app.750b60b0.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/img/icons/favicon-16x16.png"><link rel="manifest" href="/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="vuejs-webapp-sample"><link rel="apple-touch-icon" href="/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but vuejs-webapp-sample doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.575d9f70.js"></script><script src="/js/app.d4d470cd.js"></script></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><!--[if IE]><link rel="icon" href="/favicon.ico"><![endif]--><title>vuejs-webapp-sample</title><link rel="stylesheet" href="//fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic"><link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons"><link href="/css/app.750b60b0.css" rel="preload" as="style"><link href="/css/chunk-vendors.496dd37e.css" rel="preload" as="style"><link href="/js/app.562c92fd.js" rel="preload" as="script"><link href="/js/chunk-vendors.575d9f70.js" rel="preload" as="script"><link href="/css/chunk-vendors.496dd37e.css" rel="stylesheet"><link href="/css/app.750b60b0.css" rel="stylesheet"><link rel="icon" type="image/png" sizes="32x32" href="/img/icons/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/img/icons/favicon-16x16.png"><link rel="manifest" href="/manifest.json"><meta name="theme-color" content="#4DBA87"><meta name="apple-mobile-web-app-capable" content="no"><meta name="apple-mobile-web-app-status-bar-style" content="default"><meta name="apple-mobile-web-app-title" content="vuejs-webapp-sample"><link rel="apple-touch-icon" href="/img/icons/apple-touch-icon-152x152.png"><link rel="mask-icon" href="/img/icons/safari-pinned-tab.svg" color="#4DBA87"><meta name="msapplication-TileImage" content="/img/icons/msapplication-icon-144x144.png"><meta name="msapplication-TileColor" content="#000000"></head><body><noscript><strong>We're sorry but vuejs-webapp-sample doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="/js/chunk-vendors.575d9f70.js"></script><script src="/js/app.562c92fd.js"></script></body></html>
Loading

0 comments on commit fc25f65

Please sign in to comment.