tpps88206 / michael-angular-go-grpc-example

The example of gRPC project with Angular and Go

Home Page:https://medium.com/micheh/%E7%B5%90%E5%90%88-grpc-%E5%9C%A8-angular-%E8%88%87-go-%E4%B9%8B%E4%B8%AD-%E4%BD%BF%E7%94%A8-docker-%E5%AF%A6%E4%BD%9C-d682d756319

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

angular-go-grpc-example

The example of gRPC project with Angular and Go.

Structure

Status

Build Status

Platform Image size Image version
Client
Server

Development using

  • Angular 8.0.0
  • Go 1.12
  • Protocol Buffers 3.7.1

Installation

Use Docker Compose to build client, server and proxy together.

docker-compose build

Usage

Run client, server and proxy together.

docker-compose up

Access path

Client site with Angular:

http://localhost:80/

Server site with Go:

http://localhost:50051/

Access the Envoy Proxy at:

http://localhost:8080/

Protocol Buffers

If you need to modify .proto files, you can go to ./proto and then you will need to compile them again.

cd proto
vim calc.proto

# After modify
cd ..
sh ./protoc.sh

Client development mode

The Docker Image will build client with production mode. If you need to use development mode.

cd ./client
npm start

And the client access path is

http://localhost:4200/

Testing endpoints

If you want to try your server endpoint without client and proxy.

cd ./server/test
go run main.go

Reference

About

The example of gRPC project with Angular and Go

https://medium.com/micheh/%E7%B5%90%E5%90%88-grpc-%E5%9C%A8-angular-%E8%88%87-go-%E4%B9%8B%E4%B8%AD-%E4%BD%BF%E7%94%A8-docker-%E5%AF%A6%E4%BD%9C-d682d756319

License:MIT License


Languages

Language:JavaScript 53.7%Language:TypeScript 35.0%Language:Go 5.0%Language:Dockerfile 3.5%Language:HTML 1.5%Language:Shell 1.0%Language:CSS 0.3%