Skip to content

Composable and minimalistic HTTP router for building Go backend applications.

License

Notifications You must be signed in to change notification settings

nicolito128/plugo

Repository files navigation

Plugo

Composable and minimalistic HTTP router for building Go backend applications inspired by Plug.

Quick start

Require go 1.21.0 or higher.

Installation

go get github.com/nicolito128/plugo

Example

package main

import (
	"fmt"
	"log"
	"net/http"

	"github.com/nicolito128/plugo"
)

func main() {
	router := plugo.New()

	router.Get("/", hello_world)

	fmt.Println("Server running at http://localhost:8080/ - Press CTRL+C to exit")
	log.Fatal(http.ListenAndServe(":8080", router))
}

func hello_world(w http.ResponseWriter, r *http.Request) {
	conn := plugo.NewConnection(w, r)

	if err := conn.String(http.StatusOK, "Hello, Plugo World!"); err != nil {
		panic(err)
	}
}

About

Composable and minimalistic HTTP router for building Go backend applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages