01-http-service

command
v0.0.0-...-e665a74 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 4 Imported by: 0

README

HTTP service

  1. Open directory
cd /root/automation-technology/chapter02-microservices/2.2-microservices-types/01-http-service
  1. Run command to init project
go mod init automationworkshop/main
go mod tidy
  1. Run command to build project
go build .
  1. Run program
./main
  1. Run command
curl -X POST "localhost:8080/citizen"
{"status":"success"}
  1. Run command
curl -X PUT "localhost:8080/citizen/123"
{"id":"123"}
  1. Run command
curl -X GET "localhost:8080/citizen/123?page=2"
{"id":"123","page":"2"}
  1. Run command
curl -X DELETE "localhost:8080/citizen/123"
{"status":"success"}
  1. Explain the service in source code

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL