server

package
v0.0.0-...-3963976 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerCommand = &cli.Command{
	Name:      "server",
	Usage:     "Start the server",
	ArgsUsage: "[bind]",
	Action: func(c *cli.Context) error {
		bind := c.Args().First()
		if bind == "" {
			if os.Getenv("SNIPPY_BIND") != "" {
				bind = os.Getenv("SNIPPY_BIND")
			} else {
				bind = ":8080"
			}
		}

		return start(bind)
	},
}

Functions

func RenderIndex

func RenderIndex(snippets []database.Snippet) string

func RenderSnippet

func RenderSnippet(language, content, id string) string

func Shorten

func Shorten(s string) string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL