We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 536b01c commit 78dc320Copy full SHA for 78dc320
main.go
@@ -18,6 +18,8 @@ func main() {
18
r := mux.NewRouter()
19
r.HandleFunc("/", indexGetHandler).Methods("GET")
20
r.HandleFunc("/", indexPostHandler).Methods("POST")
21
+ fs := http.FileServer(http.Dir("./static/"))
22
+ r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", fs))
23
http.Handle("/", r)
24
http.ListenAndServe(":8080", nil)
25
}
static/index.css
@@ -0,0 +1,7 @@
1
+body > div {
2
+ padding: 0.5em;
3
+ width: 200px;
4
+ margin: 1em 0em;
5
+ background: #ccc;
6
+ border: 1px solid #aaa;
7
+}
templates/index.html
@@ -1,6 +1,7 @@
<html>
<head>
<title>Comments</title>
+ <link rel="stylesheet" type="text/css" href="/static/index.css">
</head>
<body>
<h1>Comments</h1>
0 commit comments