summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Manuel <nilslice@gmail.com>2016-10-04 16:28:03 -0700
committerSteve Manuel <nilslice@gmail.com>2016-10-04 16:28:03 -0700
commitd6149f5095024b71e48dfeeaecd51bbd1478267b (patch)
tree10f28011697009ae647805fd76ae56dcc5b0a3d7
parentba6ded7ee5738e424bb1a7db084e9d2f77a16544 (diff)
updating some usage and API/Admin running method
-rw-r--r--cmd/cms/main.go25
-rw-r--r--cmd/cms/options.go6
2 files changed, 19 insertions, 12 deletions
diff --git a/cmd/cms/main.go b/cmd/cms/main.go
index 87fce1c..c2f1bf1 100644
--- a/cmd/cms/main.go
+++ b/cmd/cms/main.go
@@ -41,22 +41,29 @@ generate, gen, g <type>:
-serve, s <service:port:tls>:
+serve, s <service> <port> <tls>:
Starts the 'cms' HTTP server for the JSON API, Admin System, or both.
Must be given at least one (1) parameter. The segments describe
- which services to start, in order, either 'admin'
- (Admin System / CMS backend) or 'api' (JSON API), the port to which the
- service is bound, and, optionally, if the server(s) should utilize TLS
- encryption (served over HTTPS), which is automatically managed using
- Let's Encrypt (https://letsencrypt.org)
+ which services to start, either 'admin' (Admin System / CMS
+ backend) or 'api' (JSON API), and, optionally, if the server(s) should
+ utilize TLS encryption (served over HTTPS), which is automatically managed
+ using Let's Encrypt (https://letsencrypt.org)
Example:
- $ cms serve admin:8080:tls api:8000
+ $ cms serve admin|api 8080 tls
(or)
- $ cms serve admin:8080
+ $ cms serve admin
(or)
- $ cms serve api:8000:tls
+ $ cms serve api 8888
+
+ Defaults to 'admin|api 8080' (running Admin & API on port 8080, without TLS)
+
+ Note:
+ Admin and API cannot run on separate processes unless you use a copy of the
+ database, since the first process to open it recieves a lock. If you intend
+ to run the Admin and API on separate processes, you must call them with the
+ 'cms' command independently.
`
func init() {
diff --git a/cmd/cms/options.go b/cmd/cms/options.go
index f95f800..94c809f 100644
--- a/cmd/cms/options.go
+++ b/cmd/cms/options.go
@@ -196,9 +196,9 @@ func createProjInDir(path string) error {
gopath = gopath[:len(gopath)-1]
gopath = filepath.Join(gopath, "src")
- repo := "github.com/nilslice/cms"
- local := filepath.Join(gopath, repo)
- network := "https://" + repo + ".git"
+ repo := []string{"github.com", "nilslice", "cms"}
+ local := filepath.Join(gopath, filepath.Join(repo...))
+ network := "https://" + strings.Join(repo, "/") + ".git"
// create the directory or overwrite it
err = os.MkdirAll(path, os.ModeDir|os.ModePerm)