-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
37 lines (28 loc) · 838 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package hello
import (
"html/template"
"net/http"
)
func init() {
http.Handle("/static/", http.FileServer(http.Dir(".")))
http.HandleFunc("/", index)
http.HandleFunc("/en", index_en)
http.HandleFunc("/resume", resume)
http.HandleFunc("/resume_en", resume_en)
}
func index(res http.ResponseWriter, req *http.Request) {
t, _ := template.ParseFiles("templates/index.html")
t.Execute(res, nil)
}
func index_en(res http.ResponseWriter, req *http.Request) {
t, _ := template.ParseFiles("templates/index_en.html")
t.Execute(res, nil)
}
func resume(res http.ResponseWriter, req *http.Request) {
t, _ := template.ParseFiles("templates/resume.html")
t.Execute(res, nil)
}
func resume_en(res http.ResponseWriter, req *http.Request) {
t, _ := template.ParseFiles("templates/resume_en.html")
t.Execute(res, nil)
}