-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.go
46 lines (33 loc) · 1.03 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"flag"
"fmt"
"os"
"github.com/geostant/gramaddict_helper/app"
"github.com/geostant/gramaddict_helper/utils"
)
func main() {
helpFlag := flag.Bool("help", false, "print out the help")
flag.Parse()
if *helpFlag {
help()
}
utils.InitParams()
router := utils.SetupRouter()
router.GET("/", utils.GetStatus)
router.GET("/start", app.StartApp)
router.GET("/stop", app.StopApp)
err := router.Run(":8080")
utils.CheckError(err)
}
func help() {
fmt.Println(`
Environment variables
=========================================================================================================================
ACC [Mandaotory] Instagram account name
GH [Optional] Gramaddict installation directory (default to '$HOME/gramaddict')
FILTER [Optional] Used to determine if the process running by filtering the processes (default to 'run.py')
LOG [Optional] Path to gramaddict account log file (default to '$HOME/gramaddict/logs/$INSTAGRAM_ACCOUNT.log'
`)
os.Exit(0)
}