forked from goinggo/beego-mgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
34 lines (28 loc) · 796 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Copyright 2013 Ardan Studios. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE handle.
/*
Sample web application for beego and mgo
*/
package main
import (
"github.com/astaxie/beego"
_ "github.com/goinggo/beego-mgo/routes"
"github.com/goinggo/beego-mgo/utilities/helper"
"github.com/goinggo/beego-mgo/utilities/mongo"
"github.com/goinggo/tracelog"
"os"
)
func main() {
tracelog.Start(tracelog.LEVEL_TRACE)
// Init mongo
tracelog.STARTED("main", "Initializing Mongo")
err := mongo.Startup(helper.MAIN_GO_ROUTINE)
if err != nil {
tracelog.COMPLETED_ERROR(err, helper.MAIN_GO_ROUTINE, "initApp")
os.Exit(1)
}
beego.Run()
tracelog.STARTED(helper.MAIN_GO_ROUTINE, "Website Shutdown")
tracelog.Stop()
}