This repository contains code to demonstrate how type safe API can be created using Go with client library for ELM without writing any decoding/network code.
This is the code I demonstrated on the London Elm Meetup lightning talk called "Typesafe all the way". Talk slides are available here
- Clone the code
git clone https://github.com/kenota/grpc-elm.git
- Run
dep ensure
- Run
./build.sh
this will generate 3 things:- Golang server/client stubs in
proto/gen/golang
- Openapi V2 definitions in
proto/gen/swagger
- ELM client library & decoders in
proto/gen/elm
- Golang server/client stubs in
- In terminal run
go run main.go
- Open another terminal, go to
frontend
folder and runelm reactor
- Open http://localhost:8000