-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* boot-strapped tailwind css * improved logging * removing noise
- Loading branch information
Showing
15 changed files
with
737 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package handlers | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"net/http" | ||
"path/filepath" | ||
) | ||
|
||
type StaticFileHandler struct { | ||
*BaseHandler | ||
} | ||
|
||
func NewStaticFileHandler(log *log.Logger) *StaticFileHandler { | ||
handler := &StaticFileHandler{} | ||
handler.BaseHandler = &BaseHandler{ | ||
Uri: "/static/", | ||
Log: log, | ||
UpClient: nil, | ||
UpAuth: nil, | ||
Handler: handler} | ||
return handler | ||
} | ||
func (s *StaticFileHandler) Get(w http.ResponseWriter, r *http.Request) { | ||
if r.RequestURI != "/static/css/output.css" { | ||
http.Error(w, "Internal Server Error", http.StatusInternalServerError) | ||
return | ||
} | ||
filePath := r.URL.Path[len("/static/"):] | ||
fullPath := filepath.Join(".", "static", filePath) | ||
s.Log.Println(fmt.Sprintf("Attempting to serve path: %s", fullPath)) | ||
http.ServeFile(w, r, fullPath) | ||
} | ||
|
||
func (s *StaticFileHandler) Post(w http.ResponseWriter, r *http.Request) { | ||
s.Log.Println("Unsupported HTTP Method") | ||
http.Error(w, "Internal Server Error", http.StatusInternalServerError) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,12 +7,12 @@ import ( | |
) | ||
|
||
templ AccountDetails(accounts <-chan upclient.AccountResource) { | ||
<h1>Accounts</h1> | ||
<h1 class="text-4xl">Accounts - Details</h1> | ||
<ul> | ||
for account := range accounts { | ||
@templ.Flush() { | ||
<div> | ||
<h2>{ account.Attributes.DisplayName }</h2> | ||
<h2 class="text-xl font-bold">{ account.Attributes.DisplayName }</h2> | ||
<p>Account Type: { strings.ToTitle(string(account.Attributes.AccountType)) }</p> | ||
<p>Balance: { account.Attributes.Balance.CurrencyCode } { account.Attributes.Balance.Value }</p> | ||
<p>Created At: { account.Attributes.CreatedAt.String() }</p> | ||
|
@@ -25,7 +25,7 @@ templ AccountDetails(accounts <-chan upclient.AccountResource) { | |
} | ||
|
||
templ AccountButtons(accounts <-chan upclient.AccountResource) { | ||
<h1>Accounts</h1> | ||
<h1 class="text-4xl">Accounts</h1> | ||
<ul> | ||
<form action="/transactions" method="GET"> | ||
<button type="submit">All accounts</button> | ||
|
@@ -46,6 +46,8 @@ templ Accounts(accounts1 <-chan upclient.AccountResource, accounts2 <-chan upcli | |
<head> | ||
<meta charset="UTF-8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | ||
<script src="https://unpkg.com/[email protected]"></script> | ||
<link rel="stylesheet" href="/static/css/output.css"/> | ||
<title>Accounts</title> | ||
</head> | ||
<body> | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<h1 class=\"text-4xl\">Accounts - Details</h1><ul> | ||
<div><h2 class=\"text-xl font-bold\"> | ||
</h2><p>Account Type: | ||
</p><p>Balance: | ||
|
||
</p><p>Created At: | ||
</p><p>Id: | ||
</p></div><hr> | ||
</ul> | ||
<h1 class=\"text-4xl\">Accounts</h1><ul><form action=\"/transactions\" method=\"GET\"><button type=\"submit\">All accounts</button></form> | ||
<form action=\"/transactions\" method=\"GET\"><button type=\"submit\" name=\" | ||
\" value=\" | ||
\"> | ||
|
||
|
||
</button></form> | ||
</ul> | ||
<!doctype html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><script src=\"https://unpkg.com/[email protected]\"></script><link rel=\"stylesheet\" href=\"/static/css/output.css\"><title>Accounts</title></head><body> | ||
</body></html> |
Oops, something went wrong.