Starting work on the actual website

This commit is contained in:
Caleb Gardner
2024-07-13 03:31:37 -05:00
parent e43409923c
commit 15dcc2928a
6 changed files with 97 additions and 13 deletions
+5 -4
View File
@@ -19,11 +19,12 @@ var (
mongoClient *mongo.Client
back *backend.Backend
blogApp *blog.BlogApp
webRoot *string
)
func main() {
mongoURL := flag.String("mongo", "", "Enables MongoDB usage for Darkstorm backend.")
webRoot := flag.String("web-root", "", "Sets root directory of web server.")
webRoot = flag.String("web-root", "", "Sets root directory of web server.")
flag.Parse()
if flag.NArg() != 1 {
log.Fatal("You must specify key directory. ex: darkstorm-server /etc/web-keys")
@@ -37,7 +38,7 @@ func main() {
mux := http.NewServeMux()
setupMongo(*mongoURL)
setupBackend(mux)
setupWebsite(mux, *webRoot)
setupWebsite(mux)
serv := &http.Server{
Addr: ":443",
Handler: mux,
@@ -80,6 +81,6 @@ func setupBackend(mux *http.ServeMux) {
mux.Handle("/", back)
}
func setupWebsite(mux *http.ServeMux, root string) {
//TODO
func setupWebsite(mux *http.ServeMux) {
mux.HandleFunc("GET /files", filesRequest)
}