Skip to content

Latest commit

 

History

History
74 lines (46 loc) · 839 Bytes

File metadata and controls

74 lines (46 loc) · 839 Bytes

Microservices


Fetch the Repo (locally)

$ git clone https://github.com/ContainerSolutions/codenode-workshop.git

Pre-defined API

Swagger specification:

./microservices/resources/deals-swagger.json


Building a new Microservice (v1)

Example Go implementation

open ./microservices/v1/main.go


Build and run service

$ go build .
$ go run main.go &

Call service

$ curl localhost:8080/deals?id=1

or

http://[IP_of_VM]/deals?id=1 from browser


Stop service

$ kill %1

  • Improve GoLang version
  • Use Swagger Code Gen e.g.:
java -jar /home/swagger-codegen-cli.jar generate \
  -i ./resources/deals-swagger.json \
  -l nodejs-server \
  -o nodejs
  • Write your own

Review

  • Questions?
  • On to containers...