-
Notifications
You must be signed in to change notification settings - Fork 0
/
ffs.go
61 lines (50 loc) · 885 Bytes
/
ffs.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
Main
*/
package main
import (
"os"
// "encoding/hex"
// "encoding/json"
// "flag"
"fmt"
// "io"
// "io/ioutil"
// "log"
// "math/rand"
// "net/http"
// "net/url"
// "path/filepath"
// "sort"
// "strconv"
// "strings"
// "time"
// "unicode/utf8"
"github.com/go-ini/ini"
// "github.com/gorilla/securecookie"
// "github.com/garyburd/go-oauth/oauth"
//"github.com/kjk/u"
)
func main() {
// Load Config
Config, _ := ini.Load("ffs.ini")
//fmt.Print(Config)
//fmt.Printf("%+v\n", Config)
setRootPath(Config)
HTTP_init(Config)
}
func setRootPath(Config *ini.File) {
// Set the root
pwd, err := os.Getwd()
if err != nil {
fmt.Println(err)
os.Exit(1)
}
Config.Section("App").NewKey("root", pwd + "/webroot")
// Get Root Directory
//dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
//if err != nil {
// log.Fatal(err)
//}
//fmt.Println(dir)
}