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:
28
server/mywebsite.go
Normal file
28
server/mywebsite.go
Normal 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))
|
||||
}
|
||||
Reference in New Issue
Block a user