mirror of
https://github.com/go-micro/go-micro.git
synced 2025-08-04 21:42:57 +02:00
Merge branch 'master' into defaultplugs
This commit is contained in:
23
README.md
23
README.md
@@ -87,10 +87,11 @@ func main() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Optionally set fixed address
|
Set a fixed address
|
||||||
|
|
||||||
```golang
|
```golang
|
||||||
service := micro.NewService(
|
service := micro.NewService(
|
||||||
|
micro.Name("helloworld"),
|
||||||
micro.Address(":8080"),
|
micro.Address(":8080"),
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
@@ -104,23 +105,3 @@ curl -XPOST \
|
|||||||
-d '{"name": "alice"}' \
|
-d '{"name": "alice"}' \
|
||||||
http://localhost:8080
|
http://localhost:8080
|
||||||
```
|
```
|
||||||
|
|
||||||
## Micro
|
|
||||||
|
|
||||||
Use the [Micro](https://github.com/micro/micro) cli to call it
|
|
||||||
|
|
||||||
```
|
|
||||||
micro call helloworld Say.Hello '{"name": "Asim"}'
|
|
||||||
```
|
|
||||||
|
|
||||||
Run the micro api and call it via http
|
|
||||||
|
|
||||||
```
|
|
||||||
micro api
|
|
||||||
```
|
|
||||||
|
|
||||||
Call it via http://localhost:8080/
|
|
||||||
|
|
||||||
```
|
|
||||||
curl -d '{"name": "Asim"}' https://localhost:8080/helloworld/Say/Hello
|
|
||||||
```
|
|
||||||
|
Reference in New Issue
Block a user