diff options
author | Pacien TRAN-GIRARD | 2012-09-22 18:24:51 +0200 |
---|---|---|
committer | Pacien | 2015-12-07 22:48:26 +0100 |
commit | b926c497c832f481d3e1085e69f4283e4e92415e (patch) | |
tree | eecf28d830e59dec6055f6ac21643f3e57760528 | |
parent | 229e5cd4bc19dea736200330e4f30dec860024fa (diff) | |
download | ninja-go-local-cloud-b926c497c832f481d3e1085e69f4283e4e92415e.tar.gz |
Use a default subdir for projects.
-rw-r--r-- | src/ninjacloud.go | 10 |
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 | |||
43 | const driveName = "Z" | 43 | const driveName = "Z" |
44 | const drivePrefix = driveName + ":/" | 44 | const drivePrefix = driveName + ":/" |
45 | 45 | ||
46 | const projectsDir = "Ninja" | ||
47 | |||
46 | const filePath = "/file/" | 48 | const filePath = "/file/" |
47 | const dirPath = "/directory/" | 49 | const dirPath = "/directory/" |
48 | const webPath = "/web?url=" | 50 | const 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") |