Announcing https://github.com/jackdoe/net-gemini - embeddable gemini go server
borislav nikolov
jack at sofialondonmoskva.com
Fri May 15 21:26:23 BST 2020
Hi,
First thanks for working on gemini! I have been struggling with the
modern web for a while, and finding this community makes me really
happy!
I would like to announce those two things:
* https://github.com/jackdoe/net-gemini
(made it today, so fresh out of the oven)
embeddable golang gemini server (similar to net/http)
inspired by https://tildegit.org/solderpunk/molly-brown
example usage:
gemini.HandleFunc("/example", func(w *gemini.Response, r *gemini.Request) {
if len(r.URL.RawQuery) == 0 {
w.SetStatus(gemini.StatusInput, "what is the answer to the ultimate question")
} else {
w.SetStatus(gemini.StatusSuccess, "text/gemini")
answer := r.URL.RawQuery
w.Write([]byte("HELLO: " + r.URL.Path + ", yes the answer is: " + answer))
}
})
log.Fatal(gemini.ListenAndServeTLS(":1965", "localhost.crt", "localhost.key"))
it is easy to build dynamic content (as the example shows) without
resorting to CGI due to go's setuid limitation.
* gemini://berserk.red
shell + web/gemini/finger hosting
for example:
gemini://berserk.red/~jack
I have a small hosting for my friends on https://berserk.red we use
it for talk(1) and other things. This is just to showcase usage of
net-gemini, and I used it to test and develop the api.
-b
More information about the Gemini
mailing list