web

package
v0.0.0-...-fd3f3a4 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2016 License: Apache-2.0 Imports: 24 Imported by: 0

README

Micro Web

Micro web provides a dashboard to view and query services as well as a reverse proxy to serve micro web applications. We believe in web apps as first class citizens in a microservice world.

Features

Feature Description
UI A dashboard to view and query running services
Proxy A reverse proxy to micro web services (includes websocket support)
Proxy

Micro Web has a built in HTTP reverse proxy for micro web apps. This essentially allows you to treat web applications as first class citizens in a microservices environment. The proxy will use /[service] along with the namespace (default: go.micro.web) to lookup the service in service discovery. It composes service name as [namespace].[name].

The proxy will strip /[service] forwarded the rest of the path to the web app. It will also set the header "X-Micro-Web-Base-Path" to the stripped path incase you need to use it for some reason like constructing URLs.

Example translation

Path Service Service Path Header: X-Micro-Web-Base-Path
/foo go.micro.web.foo / /foo
/foo/bar go.micro.web.foo /bar /foo

Note: The web proxy speaks to services using HTTP. There is no ability to switch out transport.

Getting Started

Install
go get github.com/micro/micro
Run Web UI/Proxy
micro web

Browse to localhost:8082

Serve Secure TLS

The Web proxy supports serving securely with TLS certificates

micro --enable_tls --tls_cert_file=/path/to/cert --tls_key_file=/path/to/key web
Set Namespace

The Web defaults to serving the namespace go.micro.web. The combination of namespace and request path are used to resolve a service to reverse proxy for.

micro --web_namespace=com.example.web

Stats

You can enable a stats dashboard via the --enable_stats flag. It will be exposed on /stats.

micro --enable_stats web

Screenshots

- - -

Documentation

Overview

Package web is a web dashboard and reverse proxy for micro web apps.

Web apps can be built as micro services and are treated as first class citizens in the Micro world. The web proxy acts much like the API proxy and also supports web sockets.

Index

Constants

This section is empty.

Variables

View Source
var (

	// Default address to bind to
	Address = ":8082"
	// The namespace to serve
	// Example:
	// Namespace + /[Service]/foo/bar
	// Host: Namespace.Service Endpoint: /foo/bar
	Namespace = "go.micro.web"
	// Base path sent to web service.
	// This is stripped from the request path
	// Allows the web service to define absolute paths
	BasePathHeader = "X-Micro-Web-Base-Path"
	// CORS specifies the hosts to allow for CORS
	CORS = map[string]bool{"*": true}
)

Functions

func Commands

func Commands() []cli.Command

func Plugins

func Plugins() []plugin.Plugin

Plugins lists the web plugins

func Register

func Register(pl plugin.Plugin) error

Register registers an web plugin

Types

This section is empty.

Jump to

Keyboard shortcuts

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