Skip to content

A URL Reversing Library for dynamically building URL paths

License

Notifications You must be signed in to change notification settings

thisissoon/novis

Repository files navigation

novis

GoDoc Build Status Coverage Status Code Climate

A URL Reversing Library for dynamically building URL paths.

package main

import (
	"fmt"
	"net/http"

	"github.com/go-chi/chi"
	"github.com/thisissoon/novis"
)

func main() {
	r := chi.NewMux()
	r.Get(novis.Add("foo", "/foo").Rel(), func(w http.ResponseWriter, r *http.Request) {
		w.Write([]byte(fmt.Sprintf("Goto Bar: %s", novis.Rev("bar"))))
	})
	r.Get(novis.Add("bar", "/bar").Rel(), func(w http.ResponseWriter, r *http.Request) {
		w.Write([]byte(fmt.Sprintf("Goto Foo: %s", novis.Rev("foo"))))
	})
	http.ListenAndServe(":5000", r)
}

About

A URL Reversing Library for dynamically building URL paths

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages