feat: linkedin
This commit is contained in:
parent
186491250e
commit
08557f45db
11 changed files with 53 additions and 24 deletions
13
src/views.go
13
src/views.go
|
@ -1,23 +1,26 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"net/http"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
func index(w http.ResponseWriter, r *http.Request) {
|
||||
http.Redirect(w, r, "/contact", http.StatusMovedPermanently)
|
||||
}
|
||||
|
||||
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 css(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Println(filepath.Join("css", getParam(r, 0)))
|
||||
http.ServeFile(w, r, filepath.Join("css", getParam(r, 0)))
|
||||
}
|
||||
|
||||
func html(w http.ResponseWriter, r *http.Request) {
|
||||
if t, found := TMPL[r.URL.Path]; found {
|
||||
if t, found := TMPL[getParam(r, 0)]; found {
|
||||
w.Write(t)
|
||||
} else {
|
||||
http.NotFound(w, r)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue