mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-10 09:52:51 +00:00
go pathing is a nightmare with app engine
This commit is contained in:
@@ -3,10 +3,11 @@ package main
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"mywebsite/server/controller/api"
|
||||
"mywebsite/server/db"
|
||||
"mywebsite/server/route"
|
||||
"mywebsite/server/utils"
|
||||
//local import paths relative to app.yaml file
|
||||
"server/controller/api"
|
||||
"server/db"
|
||||
"server/route"
|
||||
"server/utils"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"mywebsite/server/model/daily_sensor"
|
||||
"mywebsite/server/model/raw_sensor"
|
||||
"server/model/daily_sensor"
|
||||
"server/model/raw_sensor"
|
||||
)
|
||||
|
||||
// handle http request from sensors
|
||||
|
||||
@@ -25,6 +25,7 @@ func Configure(d DatabaseInfo) {
|
||||
}
|
||||
|
||||
func (d *Driver) Connect() {
|
||||
if (d.Info.URL != ""){
|
||||
// Connect to MongoDB
|
||||
s, err := mgo.DialWithTimeout(d.Info.URL, 5*time.Second)
|
||||
|
||||
@@ -44,6 +45,9 @@ func (d *Driver) Connect() {
|
||||
}
|
||||
|
||||
log.Println("Connected to database")
|
||||
} else {
|
||||
log.Println("Database not configured")
|
||||
}
|
||||
}
|
||||
|
||||
func (d *Driver) Connected() bool {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"mywebsite/server/db"
|
||||
"server/db"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"mywebsite/server/db"
|
||||
"server/db"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"mywebsite/server/controller"
|
||||
"mywebsite/server/controller/api"
|
||||
"server/controller"
|
||||
"server/controller/api"
|
||||
)
|
||||
|
||||
func Routes() *httprouter.Router {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"mywebsite/server/controller/api"
|
||||
"mywebsite/server/db"
|
||||
"server/controller/api"
|
||||
"server/db"
|
||||
)
|
||||
|
||||
//structure for application configurations
|
||||
|
||||
Reference in New Issue
Block a user