2018-03-30 21:16:51 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2018-05-28 18:05:06 +00:00
|
|
|
cwtchserver "cwtch.im/cwtch/server"
|
2018-05-09 19:09:00 +00:00
|
|
|
"log"
|
2018-11-01 17:32:26 +00:00
|
|
|
"os"
|
2018-03-30 21:16:51 +00:00
|
|
|
)
|
|
|
|
|
2018-06-18 22:57:21 +00:00
|
|
|
const (
|
|
|
|
serverConfigFile = "serverConfig.json"
|
|
|
|
)
|
2018-05-03 22:45:50 +00:00
|
|
|
|
2018-03-30 21:16:51 +00:00
|
|
|
func main() {
|
2018-11-01 17:32:26 +00:00
|
|
|
configDir := os.Getenv("CWTCH_CONFIG_DIR")
|
|
|
|
|
2018-11-01 20:22:29 +00:00
|
|
|
serverConfig := cwtchserver.LoadConfig(configDir, serverConfigFile)
|
2018-05-03 22:45:50 +00:00
|
|
|
|
2018-03-30 21:16:51 +00:00
|
|
|
server := new(cwtchserver.Server)
|
|
|
|
log.Printf("starting cwtch server...")
|
|
|
|
|
2018-06-03 19:36:20 +00:00
|
|
|
// TODO load params from .cwtch/server.conf or command line flag
|
2018-06-18 22:57:21 +00:00
|
|
|
server.Run(serverConfig)
|
2018-06-19 22:38:22 +00:00
|
|
|
}
|