URL shortener and file dump for hashru.link
https://hashru.link
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
809 B
31 lines
809 B
package main |
|
|
|
import ( |
|
"flag" |
|
"log" |
|
|
|
"gitea.hashru.nl/dsprenkels/rushlink" |
|
"gitea.hashru.nl/dsprenkels/rushlink/internal/db" |
|
) |
|
|
|
var ( |
|
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)") |
|
rootURL = flag.String("root_url", "", "host root (example: 'https://example.com', uses an educated guess if omitted)") |
|
) |
|
|
|
func main() { |
|
flag.Parse() |
|
|
|
filestore, err := db.OpenFileStoreFromEnvironment() |
|
if err != nil { |
|
log.Fatalln(err) |
|
} |
|
database, err := db.OpenDBFromEnvironment() |
|
if err != nil { |
|
log.Fatalln(err) |
|
} |
|
|
|
go rushlink.StartMetricsServer(*metricsListen, database, filestore) |
|
rushlink.StartMainServer(*httpListen, database, filestore, *rootURL) |
|
}
|
|
|