diff --git a/html/index.html b/html/index.html index c7cda3c..534b1ba 100644 --- a/html/index.html +++ b/html/index.html @@ -41,6 +41,8 @@ Phone (France)+33 5 82 95 16 23 Emailange@yw5n.com WhatsApp+62 853-3355-9453 + PGPpgp.asc + SSHssh diff --git a/src/main.go b/src/main.go index d7b6ef3..64cefdd 100644 --- a/src/main.go +++ b/src/main.go @@ -5,8 +5,6 @@ import ( "net/http" ) -// TODO: html templates -// TODO: download resume as PDF func main() { http.HandleFunc("/", Route) diff --git a/src/route.go b/src/route.go index 0328ee9..020bdd7 100644 --- a/src/route.go +++ b/src/route.go @@ -4,33 +4,21 @@ import ( "context" "fmt" "net/http" - "path/filepath" "regexp" "slices" ) type URLParam struct{} -type W = http.ResponseWriter -type R = *http.Request - var routes = []struct { methods []string regex *regexp.Regexp handler http.HandlerFunc }{ - {[]string{"GET"}, URL(""), func(w W, r R) { - http.ServeFile(w, r, filepath.Join("html", "index.html")) - }}, - {[]string{"GET"}, URL("/style\\.css"), func(w W, r R) { - http.ServeFile(w, r, "/html/style.css") - }}, - {[]string{"GET"}, URL("/static/.+"), func(w W, r R) { - http.ServeFile(w, r, r.URL.Path) - }}, - {[]string{"GET"}, URL("/[^/]+"), func(w W, r R) { - http.ServeFile(w, r, filepath.Join("html", r.URL.Path + ".html")) - }}, + {[]string{"GET"}, URL(""), Index}, + {[]string{"GET"}, URL("/style\\.css"), Style}, + {[]string{"GET"}, URL("/static/.+"), Static}, + {[]string{"GET"}, URL("/[^/]+"), HTML}, } func URL(s string) *regexp.Regexp { diff --git a/src/views.go b/src/views.go new file mode 100644 index 0000000..5b3d8d9 --- /dev/null +++ b/src/views.go @@ -0,0 +1,22 @@ +package main + +import ( + "net/http" + "path/filepath" +) + +func Index(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, filepath.Join("html", "index.html")) +} + +func Style(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, "/html/style.css") +} + +func Static(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, r.URL.Path) +} + +func HTML(w http.ResponseWriter, r *http.Request) { + http.ServeFile(w, r, filepath.Join("html", r.URL.Path + ".html")) +} diff --git a/static/pgp.asc b/static/pgp.asc new file mode 100644 index 0000000..b9b6c46 --- /dev/null +++ b/static/pgp.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mDMEZZrW3RYJKwYBBAHaRw8BAQdAMGz3VvtiVS7x3o/vyS78SovgFsB1mVnMWSU8 +sLb2QPe0FGFuZ2UgPGFuZ2VAeXc1bi5jb20+iI4EExYKADYCGwMCF4AWIQSC7Npn +RPOETDoVXXmeDEFXu3vrHQUCZb0M5gQLCQgHBRUKCQgLBBYCAwECHgUACgkQngxB +V7t76x26JAEAoS8KVxiVqT3/7idNbLkMXj0xLaZZQ2bY4F9Y13N17nYA/3u53+ZQ +gU6rm/YlAY4VMGNKaaSN2bavQrHPO56L3r8GuDgEZZrW3RIKKwYBBAGXVQEFAQEH +QFggUlxGt6JJPzluPVouPSZoJ2lJxTKI6FRISwNGht4KAwEIB4h4BBgWCgAgFiEE +guzaZ0TzhEw6FV15ngxBV7t76x0FAmWa1t0CGwwACgkQngxBV7t76x3SJAD9FpRY +omgI/X4t0YvPOOhZYiA7ZS8iAQ8fHEIVAadyHAQBAOlaXQR/x8HoBlkfH5kxy0V+ +e93ULsxwcC/c6liRSYkEuDMEZZrW8hYJKwYBBAHaRw8BAQdANRxx2WBQfNX4CFYP +KPBwbhDBI1vJshXwwXtzpekpCXiIeAQYFgoAIBYhBILs2mdE84RMOhVdeZ4MQVe7 +e+sdBQJlmtbyAhsgAAoJEJ4MQVe7e+sduyAA/iaw4bd8lIMnHku34/gzPByFc6FU +00vyLLODY4oV0vmTAQC5m2qKl4keqziTH+opyv1nqGgEjHLO92gWYSkRpA6CDg== +=VMSs +-----END PGP PUBLIC KEY BLOCK----- diff --git a/static/ssh b/static/ssh new file mode 100644 index 0000000..c78f7dd --- /dev/null +++ b/static/ssh @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDUccdlgUHzV+AhWDyjwcG4QwSNbybIV8MF7c6XpKQl4