|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
* @Author: Bartuccio Antoine
|
|
|
|
|
* @Date: 2018-07-14 11:32:11
|
|
|
|
|
* @Last Modified by: klmp200
|
|
|
|
|
* @Last Modified time: 2018-07-18 19:41:18
|
|
|
|
|
* @Last Modified time: 2018-07-18 20:06:08
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
package gowebframework
|
|
|
|
@ -29,7 +29,7 @@ type Config struct {
|
|
|
|
|
StaticFolderPath string
|
|
|
|
|
TemplateExtensionPattern string
|
|
|
|
|
ServerPort string
|
|
|
|
|
ServerListenAdress string
|
|
|
|
|
ServerListenAddress string
|
|
|
|
|
SessionProvider string
|
|
|
|
|
Domain string
|
|
|
|
|
Debug bool
|
|
|
|
@ -55,8 +55,8 @@ func Configure(config_file_name string, custom_config_file_name string) {
|
|
|
|
|
// Starts server
|
|
|
|
|
func Start() {
|
|
|
|
|
http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir(ServerConfig.StaticFolderPath))))
|
|
|
|
|
log.Println("Server listening on http://" + ServerConfig.ServerListenAdress + ":" + ServerConfig.ServerPort)
|
|
|
|
|
log.Fatal(http.ListenAndServe(ServerConfig.ServerListenAdress+":"+ServerConfig.ServerPort, nil))
|
|
|
|
|
log.Println("Server listening on http://" + ServerConfig.ServerListenAddress + ":" + ServerConfig.ServerPort)
|
|
|
|
|
log.Fatal(http.ListenAndServe(ServerConfig.ServerListenAddress+":"+ServerConfig.ServerPort, nil))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func loadDefaultConfiguration() {
|
|
|
|
@ -65,7 +65,7 @@ func loadDefaultConfiguration() {
|
|
|
|
|
ServerConfig.TemplateLayoutPath = "templates/layouts/"
|
|
|
|
|
ServerConfig.TemplateExtensionPattern = "*.gohtml"
|
|
|
|
|
ServerConfig.ServerPort = "8000"
|
|
|
|
|
ServerConfig.ServerListenAdress = "0.0.0.0"
|
|
|
|
|
ServerConfig.ServerListenAddress = "0.0.0.0"
|
|
|
|
|
ServerConfig.Domain = "localhost"
|
|
|
|
|
ServerConfig.MainTemplate = `{{define "main" }} {{ template "base" . }} {{ end }}`
|
|
|
|
|
ServerConfig.Debug = false
|
|
|
|
|