1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-03-23 20:32:32 +02:00
2020-12-26 15:17:20 +00:00

549 B

Beego API Example

This is an example of how to serve an API using beego

Getting Started

Run the Micro API

$ micro api --handler=http

Run the Greeter Service

$ go run greeter/srv/main.go

### Run the Greeter API

$ go run beego.go

Curl API

Test the index

curl http://localhost:8080/greeter

Output

{
  "message": "Hi, this is the Greeter API"
}

Test a resource

 curl http://localhost:8080/greeter/asim

Output

{
  "msg": "Hello asim"
}