This commit is contained in:
Barak Michener 2016-10-31 15:37:00 -07:00
parent 5d40de4bf3
commit 902cb5dd23
5 changed files with 67 additions and 3 deletions

View file

@ -1,11 +1,25 @@
package main
import "git.barakmich.com/barak/hoboken"
import (
"flag"
"path/filepath"
"git.barakmich.com/barak/hoboken"
)
var (
path = flag.String("path", "./", "Set working path to watch for new projects")
host = flag.String("host", "0.0.0.0", "Listen host")
port = flag.String("port", "8081", "Listen port")
)
func main() {
p, err := hoboken.NewProjects("./")
flag.Parse()
p, err := hoboken.NewProjects(*path)
if err != nil {
panic(err)
}
hoboken.WatchDir("./...", p)
go hoboken.WatchDir(filepath.Join(*path, "/..."), p)
hp := *host + ":" + *port
hoboken.Listen(hp, p)
}