diff --git a/main.go b/main.go index 56d7949..2dc114b 100644 --- a/main.go +++ b/main.go @@ -46,82 +46,95 @@ func passwordHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, password) } +// new help handler func helpHandler(w http.ResponseWriter, r *http.Request) { - helpHTML := ` - - - - Hilfe - - - - -
-

Hilfe: API-Endpunkt

-

- Diese Anwendung bietet einen API-Endpunkt, um Passwörter direkt über die Kommandozeile abzurufen. - Der Endpunkt gibt das Passwort im Plain-Text-Format zurück. -

-

Endpunkt:

-

http://localhost:8080/api/password

-

Beispiele:

-

Mac/Linux (Terminal):

-
echo $(curl -s http://localhost:8080/api/password)
-

Windows (PowerShell):

-
Invoke-RestMethod -Uri http://localhost:8080/api/password
-

Windows (cmd):

-
curl http://localhost:8080/api/password
-

- Zurück zur Passwort-Generierung -

-
- - - ` - w.Header().Set("Content-Type", "text/html; charset=utf-8") - fmt.Fprint(w, helpHTML) + helpHTML := ` + + + + Hilfe + + + + +
+

Hilfe: API-Endpunkt

+

+ Diese Anwendung bietet einen API-Endpunkt, um Passwörter direkt über die Kommandozeile abzurufen. + Der Endpunkt gibt das Passwort im Plain-Text-Format zurück. +

+

Endpunkt:

+

+

Beispiele:

+

Mac/Linux (Terminal):

+

+            

Windows (PowerShell):

+

+            

Windows (cmd):

+

+            

+ Zurück zur Passwort-Generierung +

+
+ + + + ` + w.Header().Set("Content-Type", "text/html; charset=utf-8") + fmt.Fprint(w, helpHTML) } + func webHandler(w http.ResponseWriter, r *http.Request) { password := generatePassword() html := fmt.Sprintf(