Skip to content

1e99/gem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💎 Gem

A library to quickly build gemini capsules using go.

Installation

Installing Gem can be done easily using go get:

go get github.com/c-128/gem

Examples

package main

import (
	"io"

	"github.com/c-128/gem"
)

func helloGemini(ctx *gem.Ctx) error {
	ctx.Status(gem.StatusSuccess, "text/gemini")

	_, err := io.WriteString(ctx, "# Hello gemini!\n")
	if err != nil {
		return err
	}

	return nil
}

func main() {
	err := gem.ServeAndListen(
		"0.0.0.0:1965",
		helloGemini,
		"cert/cert.crt",
		"cert/key.key",
	)
	if err != nil {
		panic(err)
	}
}

Check out more examples in the examples folder.

About

A library to build gemini capsules with go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages