Add support for file uploads
This commit is contained in:
@@ -8,18 +8,22 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
databasePath = flag.String("database", "", "location of the database file")
|
||||
httpListen = flag.String("listen", "127.0.0.1:8000", "listen address (host:port)")
|
||||
databasePath = flag.String("database", "", "location of the database file")
|
||||
fileStorePath = flag.String("file-store", "", "path to the directory where uploaded files will be stored")
|
||||
httpListen = flag.String("listen", "127.0.0.1:8000", "listen address (host:port)")
|
||||
metricsListen = flag.String("metrics_listen", "127.0.0.1:58614", "listen address for metrics (host:port)")
|
||||
)
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
|
||||
if err := rushlink.Open(*databasePath); err != nil {
|
||||
if err := rushlink.OpenDB(*databasePath); err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
defer rushlink.CloseDB()
|
||||
if err := rushlink.OpenFileStore(*fileStorePath); err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
defer rushlink.Close()
|
||||
|
||||
go rushlink.StartMetricsServer(*metricsListen)
|
||||
rushlink.StartMainServer(*httpListen)
|
||||
|
||||
Reference in New Issue
Block a user