routes

package
v0.0.0-...-c5bcced Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

The routes package enables specifying dynamic http routes.

var api = require('routes');

api.get("/", function(path, args) {
	console.log(path, args);
});

api.any("/:one", function(path, args) {
	console.log(path, args);
});

api.any("/:one/:two", function(path, args) {
	console.log(path, args);
});

api.get("/help/:article", function(path, args) {
	console.log(path, args);
});

api.run();

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(orb *orbit.Orbit) interface{}

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

func (*Module) Any

func (this *Module) Any(path string, call otto.Value)

func (*Module) Connect

func (this *Module) Connect(path string, call otto.Value)

func (*Module) Delete

func (this *Module) Delete(path string, call otto.Value)

func (*Module) Get

func (this *Module) Get(path string, call otto.Value)

func (*Module) Options

func (this *Module) Options(path string, call otto.Value)

func (*Module) Patch

func (this *Module) Patch(path string, call otto.Value)

func (*Module) Post

func (this *Module) Post(path string, call otto.Value)

func (*Module) Put

func (this *Module) Put(path string, call otto.Value)

func (*Module) Run

func (this *Module) Run()

func (*Module) Trace

func (this *Module) Trace(path string, call otto.Value)

Jump to

Keyboard shortcuts

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