1
0
mirror of https://github.com/mgerb/mywebsite synced 2026-01-11 18:32:50 +00:00

new post - updated server directories

This commit is contained in:
2016-08-31 17:46:05 +00:00
parent 97598ba7e8
commit 0c531a30c2
6 changed files with 213 additions and 70 deletions

28
server/mywebsite.go Normal file
View File

@@ -0,0 +1,28 @@
package main
import (
"log"
"net/http"
"strconv"
"github.com/NYTimes/gziphandler"
"mywebsite/server/controller/api"
"mywebsite/server/db"
"mywebsite/server/route"
"mywebsite/server/utils"
)
func main(){
configurations := utils.ReadConfig()
db.Configure(configurations.Database)
api.Configure(configurations.Api)
db.Mongo.Connect()
//register middleware
handle := gziphandler.GzipHandler(route.Routes())
log.Println("Starting Server...")
log.Println(http.ListenAndServe(":"+strconv.Itoa(configurations.Port), handle))
}