summaryrefslogtreecommitdiffstats
path: root/mattermost.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-06-14 23:53:32 -0800
committer=Corey Hulen <corey@hulen.com>2015-06-14 23:53:32 -0800
commit56e74239d6b34df8f30ef046f0b0ff4ff0866a71 (patch)
tree044da29848cf0f5c8607eac34de69065171669cf /mattermost.go
downloadchat-56e74239d6b34df8f30ef046f0b0ff4ff0866a71.tar.gz
chat-56e74239d6b34df8f30ef046f0b0ff4ff0866a71.tar.bz2
chat-56e74239d6b34df8f30ef046f0b0ff4ff0866a71.zip
first commit
Diffstat (limited to 'mattermost.go')
-rw-r--r--mattermost.go44
1 files changed, 44 insertions, 0 deletions
diff --git a/mattermost.go b/mattermost.go
new file mode 100644
index 000000000..56010c6a4
--- /dev/null
+++ b/mattermost.go
@@ -0,0 +1,44 @@
+// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved.
+// See License.txt for license information.
+
+package main
+
+import (
+ "flag"
+ "fmt"
+ "github.com/mattermost/platform/api"
+ "github.com/mattermost/platform/manualtesting"
+ "github.com/mattermost/platform/utils"
+ "github.com/mattermost/platform/web"
+ "os"
+ "os/signal"
+ "syscall"
+)
+
+func main() {
+
+ pwd, _ := os.Getwd()
+ fmt.Println("Current working directory is set to " + pwd)
+
+ var config = flag.String("config", "config.json", "path to config file")
+ flag.Parse()
+
+ utils.LoadConfig(*config)
+ api.NewServer()
+ api.InitApi()
+ web.InitWeb()
+ api.StartServer()
+
+ // If we allow testing then listen for manual testing URL hits
+ if utils.Cfg.ServiceSettings.AllowTesting {
+ manualtesting.InitManualTesting()
+ }
+
+ // wait for kill signal before attempting to gracefully shutdown
+ // the running service
+ c := make(chan os.Signal)
+ signal.Notify(c, os.Interrupt, syscall.SIGINT, syscall.SIGTERM)
+ <-c
+
+ api.StopServer()
+}