summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacien TRAN-GIRARD2012-09-22 18:24:51 +0200
committerPacien2015-12-07 22:48:26 +0100
commitb926c497c832f481d3e1085e69f4283e4e92415e (patch)
treeeecf28d830e59dec6055f6ac21643f3e57760528
parent229e5cd4bc19dea736200330e4f30dec860024fa (diff)
downloadninja-go-local-cloud-b926c497c832f481d3e1085e69f4283e4e92415e.tar.gz
Use a default subdir for projects.
-rw-r--r--src/ninjacloud.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ninjacloud.go b/src/ninjacloud.go
index 58146f7..235a9be 100644
--- a/src/ninjacloud.go
+++ b/src/ninjacloud.go
@@ -43,6 +43,8 @@ var rootFlag string
43const driveName = "Z" 43const driveName = "Z"
44const drivePrefix = driveName + ":/" 44const drivePrefix = driveName + ":/"
45 45
46const projectsDir = "Ninja"
47
46const filePath = "/file/" 48const filePath = "/file/"
47const dirPath = "/directory/" 49const dirPath = "/directory/"
48const webPath = "/web?url=" 50const webPath = "/web?url="
@@ -629,7 +631,7 @@ func getStatusHandler(w http.ResponseWriter, r *http.Request) {
629 cloudStatus := map[string]string{ 631 cloudStatus := map[string]string{
630 "name": APP_NAME, 632 "name": APP_NAME,
631 "version": APP_VERSION, 633 "version": APP_VERSION,
632 "server-root": drivePrefix, 634 "server-root": drivePrefix + projectsDir,
633 "status": "running", 635 "status": "running",
634 } 636 }
635 j, err := json.MarshalIndent(cloudStatus, "", " ") 637 j, err := json.MarshalIndent(cloudStatus, "", " ")
@@ -662,6 +664,12 @@ func main() {
662 log.Println(err) 664 log.Println(err)
663 return 665 return
664 } 666 }
667
668 err = createDir(projectsDir)
669 if err != nil {
670 log.Println(err)
671 return
672 }
665 673
666 log.Println("Starting " + APP_NAME + " " + APP_VERSION + " on " + interfaceFlag + ":" + portFlag + " in " + currentDir) 674 log.Println("Starting " + APP_NAME + " " + APP_VERSION + " on " + interfaceFlag + ":" + portFlag + " in " + currentDir)
667 log.Println("pacien.net/projects/ninja-go-local-cloud") 675 log.Println("pacien.net/projects/ninja-go-local-cloud")