Basic Bitch HTTP server with some mild convenience and terribleness baked right in.
Go to file
2023-08-01 13:34:08 -04:00
servlet updated a bunch of docs 2023-08-01 13:34:08 -04:00
vinegarUtil added readme 2023-08-01 12:53:09 -04:00
.gitignore added idea stuff to gitignore 2022-07-19 15:38:54 -04:00
go.mod tenative draft of template routes 2022-08-03 11:08:25 -04:00
README.md added readme 2023-08-01 12:53:09 -04:00

Vinegar

Vinegar is a simple web application framework written in Go.

Features

Routing with support for static files, templates, APIs Template rendering Caching Gzip compression Custom error pages Getting Started Prerequisites

Go 1.18+

Installation

go get geniuscartel.xyz/vinegar

Usage

Create a config.json file to define routes and options

Import Vinegar and create a new server instance:

import "geniuscartel.xyz/vinegar"

func main(){
    server := vinegar.NewServer(config)
    Add handlers for API routes:
    api := server.NewApiRoute("/api")
    api.Get(handleGet)
    Start the server:
    server.Start(":8080")
}

See the examples folder for more usage examples.

Configuration

The config.json file defines the routes and options for Vinegar. It supports the following route types:

  • static - Map a URL pattern to a static file or directory
  • template - Render a Go template on a route
  • api - Add API routes with custom handlers
  • See config_example.json for a sample configuration file.

License

Vinegar is closed source. Copyright 2023 David Tookey. All rights reserved