Skip to content

Commit

Permalink
init employee
Browse files Browse the repository at this point in the history
  • Loading branch information
henriquepw committed Aug 17, 2024
1 parent 5cd686a commit 0a4bb38
Show file tree
Hide file tree
Showing 16 changed files with 166 additions and 803 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ go.work
main
*templ.go
*.txt
static/output.css
static/css/output.css

# mac stuff
.DS_Store
14 changes: 13 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,25 @@ func main() {
homeHandler := handler.NewHomeHandler()
server.HandleFunc("/", homeHandler.HomePage)

clientHandler := handler.NewClientHandler()
server.HandleFunc("GET /clients", clientHandler.ClientsPage)

employeeHandler := handler.NewEmployeeHandler()
server.HandleFunc("GET /employees", employeeHandler.EmployeesPage)
server.HandleFunc("GET /employees/create", employeeHandler.EmployeeCreatePage)

authHandler := handler.NewAuthHandler()
server.HandleFunc("GET /login", authHandler.LoginPage)
server.HandleFunc("POST /login", authHandler.Login)
server.HandleFunc("/logout", authHandler.Logout)

fs := http.FileServer(http.Dir("./static"))
server.Handle("/static/", http.StripPrefix("/static/", fs))
server.Handle("/static/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
w.Header().Set("Pragma", "no-cache")
w.Header().Set("Expires", "0")
http.StripPrefix("/static/", fs).ServeHTTP(w, r)
}))

err := http.ListenAndServe(addr, server)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions static/css/input.css
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,6 @@
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;

border-color: var(--sand-8);
}
Loading

0 comments on commit 0a4bb38

Please sign in to comment.