func main() {
paramDeploy := flag.Bool(
"d", false, "A flag specifying the deploy mode of the server.")
+ paramDebug := flag.Bool(
+ "debug", false, "A flag specifying whether the server should be in debug mode.")
paramPort := flag.Int(
"p", 8000, "The port the server should be deployed on.")
_ = flag.String(
logger.RequestLog = log.New(logFile, "[REQUEST] ", logger.LoggerFlags)
logger.ErrorLog = log.New(logFile, "[ERROR] ", logger.LoggerFlags)
+ if *paramDebug {
+ fmt.Println("Running in debug mode.")
+ }
+
cssDir := http.Dir("static/css")
imgDir := http.Dir("static/images")
jsDir := http.Dir("static/js")
}
router := mux.NewRouter()
- router.HandleFunc("/", handlers.HandleIndex)
+
+ if *paramDebug {
+ router.HandleFunc("/", handlers.HandleIndexDebug)
+ } else {
+ router.HandleFunc("/", handlers.HandleIndex)
+ }
http.Handle("/", router)
http.Handle("/css/", http.StripPrefix("/css/", http.FileServer(cssDir)))
}
if err != nil {
- logger.ErrorLog.Fatalf("Listen and serve failed with:", err)
+ logger.ErrorLog.Fatalf("Listen and serve failed with: %v", err)
}
}
w.Write([]byte("error oopsie woopsie"))
}
}
+
+func HandleIndexDebug(w http.ResponseWriter, r *http.Request) {
+ indexTemplate, err := template.ParseFiles("static/templates/index.html")
+ if err != nil {
+ w.Write([]byte("error oopsie woopsie"))
+ }
+ err = indexTemplate.Execute(w, IndexPageStruct{})
+
+ if err != nil {
+ w.Write([]byte("error oopsie woopsie"))
+ }
+}
@font-face {
src: url("/fonts/JosefinSans_VariableFont_wght.ttf");
font-family: JosefinSans;
- font-weight: 400;
- font-style: normal;
}
* {
padding: 0;
}
+h1 {
+ color: var(--text);
+ margin-top: 5px;
+ margin-bottom: 5px;
+}
+
+.title {
+ font-weight: bold;
+}
+
+.dualbar {
+ display: flex;
+ width: 100%;
+ justify-content: space-between;
+}
+
#sidebar {
position: fixed;
width: 20%;
height: 100vh;
background-color: var(--bg);
+ padding: 5px;
box-shadow: 4px 4px 0px var(--text);
border-right: 3px solid black;
}
+.inner-sidebar {
+}