mirror of
https://github.com/go-micro/go-micro.git
synced 2025-09-16 08:36:30 +02:00
feat: delete redundant lines (#2364)
This commit is contained in:
@@ -6,8 +6,6 @@ An example Greeter application
|
|||||||
|
|
||||||
- **srv** - an RPC greeter service
|
- **srv** - an RPC greeter service
|
||||||
- **cli** - an RPC client that calls the service once
|
- **cli** - an RPC client that calls the service once
|
||||||
- **api** - examples of RPC API and RESTful API
|
|
||||||
- **web** - how to use go-web to write web services
|
|
||||||
|
|
||||||
## Run Service
|
## Run Service
|
||||||
|
|
||||||
@@ -16,7 +14,7 @@ Start go.micro.srv.greeter
|
|||||||
go run srv/main.go
|
go run srv/main.go
|
||||||
```
|
```
|
||||||
|
|
||||||
## Client
|
## Run Client
|
||||||
|
|
||||||
Call go.micro.srv.greeter via client
|
Call go.micro.srv.greeter via client
|
||||||
```shell
|
```shell
|
||||||
@@ -24,41 +22,3 @@ go run cli/main.go
|
|||||||
```
|
```
|
||||||
|
|
||||||
Examples of client usage via other languages can be found in the client directory.
|
Examples of client usage via other languages can be found in the client directory.
|
||||||
|
|
||||||
## API
|
|
||||||
|
|
||||||
HTTP based requests can be made via the micro API. Micro logically separates API services from backend services. By default the micro API
|
|
||||||
accepts HTTP requests and converts to *api.Request and *api.Response types. Find them here [micro/api/proto](https://github.com/micro/micro/tree/master/api/proto).
|
|
||||||
|
|
||||||
Run the go.micro.api.greeter API Service
|
|
||||||
```shell
|
|
||||||
go run api/api.go
|
|
||||||
```
|
|
||||||
|
|
||||||
Run the micro API
|
|
||||||
```shell
|
|
||||||
micro api --handler=api
|
|
||||||
```
|
|
||||||
|
|
||||||
Call go.micro.api.greeter via API
|
|
||||||
```shell
|
|
||||||
curl http://localhost:8080/greeter/say/hello?name=John
|
|
||||||
```
|
|
||||||
|
|
||||||
Examples of other API handlers can be found in the API directory.
|
|
||||||
|
|
||||||
## Web
|
|
||||||
|
|
||||||
The micro web is a web dashboard and reverse proxy to run web apps as microservices.
|
|
||||||
|
|
||||||
Run go.micro.web.greeter
|
|
||||||
```
|
|
||||||
go run web/web.go
|
|
||||||
```
|
|
||||||
|
|
||||||
Run the micro web
|
|
||||||
```shell
|
|
||||||
micro web
|
|
||||||
```
|
|
||||||
|
|
||||||
Browse to http://localhost:8082/greeter
|
|
||||||
|
Reference in New Issue
Block a user