Skip to content

Latest commit

 

History

History
26 lines (20 loc) · 688 Bytes

README.md

File metadata and controls

26 lines (20 loc) · 688 Bytes

Gemini Server

A simple Go library to build Gemini web servers.

Example

The basic structure is similar to net/http.

package main

import (
	"log"

	"github.com/cvhariharan/gemini-server"
)

func main() {
	gemini.HandleFunc("/", func(w *gemini.Response, r *gemini.Request) {
		w.SetStatus(gemini.StatusSuccess, "text/gemini")
		w.Write([]byte("# Test Response"))
	})

	log.Fatal(gemini.ListenAndServeTLS(":1965", "localhost.crt", "localhost.key"))
}

Gemini clients allow self-signed certificates.
You can use any client to view the contents. My personal favourite is Amfora.