Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"sync"
"sync/atomic"
"time"
"github.com/devfeel/dotweb/framework/sysx"
)

var GlobalState *ServerStateInfo
Expand Down Expand Up @@ -106,6 +107,8 @@ type ServerStateInfo struct {
//ShowHtmlData show server state data html-string format
func (state *ServerStateInfo) ShowHtmlData(version string) string {
data := "<html><body><div>"
data += "HostInfo : " + sysx.GetHostName()
data += "<br>"
data += "CurrentTime : " + time.Now().Format("2006-01-02 15:04:05")
data += "<br>"
data += "ServerVersion : " + version
Expand Down
9 changes: 9 additions & 0 deletions framework/sysx/sysx.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package sysx

import "os"

// GetHostName get host name
func GetHostName() string{
host, _ := os.Hostname()
return host
}
1 change: 0 additions & 1 deletion router.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ func (r *router) ServeHTTP(ctx *HttpContext) {
}

// Handle 404
ctx.Response().SetStatusCode(http.StatusNotFound)
r.server.DotApp.NotFoundHandler(ctx)
}

Expand Down
6 changes: 6 additions & 0 deletions version.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## dotweb版本记录:

#### Version 1.5.7.4
* Fixed Bug: Remove auto set NotFound http status when happened 404, if auto set, it will ignore any ContentType set
* For issue #149 router middleware handle http 404,405. cann`t response content-type:application/json, Thanks for @lyw1995
* Update: Add HostName in State page
* 2018-08-28 13:00

#### Version 1.5.7.3
* New Feature: Add HttpServer.VirtualPath, used to set virtual path when deploy on no root path
* Detail:
Expand Down