frontend

package module
v0.0.0-...-9a943c6 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2017 License: BSD-3-Clause Imports: 2 Imported by: 0

README

frontend

a Ponzu addon to create a web frontend for your CMS.

To install:

from within your Ponzu project, run:

$ ponzu add github.com/bosssauce/frontend

Usage:

// content/song.go

package content

import (
    // import the frontend addon
    "github.com/bosssauce/frontend"
    ...
)

type Song struct {
    title   string  `json:"title"`
    ...
}

func init() {
    // add routes/handlers to the frontend Router, which embeds a *mux.Router
    frontend.Router.HandleFunc("/songs", func(res http.ResponseWriter, req *http.Request) {
        // GET /api/contents?type=Song
        ...
    })
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Router is exported so any content type file can just call frontend.Router.HandleFunc(....
	// otherwise, a New() func might be needed, but it is not clear where it should be called from
	Router *router
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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