Skip to content

cvhariharan/gemini-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A simple Go library to build Gemini servers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages