proxy

command
v0.0.0-...-bf4ab67 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

README

Proxy API

This is an example of using the micro api as a http proxy.

Using the api as a http proxy gives you complete control over what languages or libraries to use at the API layer. In this case we're using go-web to easily register http services.

Usage

Run micro api with http proxy handler

micro api --handler=http

Run this proxy service

go run proxy.go

Make a GET request to /example/call which will call go.micro.api.example Example.Call

curl "http://localhost:8080/example/call?name=john"

Make a POST request to /example/foo/bar which will call go.micro.api.example Foo.Bar

curl -H 'Content-Type: application/json' -d '{}' http://localhost:8080/example/foo/bar

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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