1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Added rudimentary install script

This commit is contained in:
Zack Scholl
2016-02-06 09:11:02 -05:00
parent dbcb7a42c9
commit 107e20c283
5 changed files with 109 additions and 5 deletions

View File

@ -5,6 +5,7 @@ import (
"fmt"
"log"
"net/http"
"os"
"path"
"runtime"
"time"
@ -16,6 +17,7 @@ import (
var db *bolt.DB
var open bool
var ExternalIP string
func Open() error {
var err error
@ -107,6 +109,10 @@ func (p *CowyoData) decode(data []byte) error {
}
func main() {
if len(os.Args) == 1 {
log.Fatal("You need to specify the external IP address")
}
ExternalIP = os.Args[1]
Open()
defer Close()
r := gin.Default()
@ -123,7 +129,8 @@ func main() {
wshandler(c.Writer, c.Request)
} else {
c.HTML(http.StatusOK, "index.tmpl", gin.H{
"Title": title,
"Title": title,
"ExternalIP": ExternalIP,
})
}