OpenMRS
GoLang-1: Create a Hello World Server
This will be a set of tasks to introduce you to Go for backend development.
- Download Go 1.13.5 SDK.
- Make sure the SDK directory is in your PATH. (you can check by running
go version
in your terminal). - Create a directory and run
go mod init <GITHUB_URL>
.GITHUB_URL
is the location where your GitHub repository will be (e.g.github.com/f4ww4z/gci-openmrs-go-1
. This will initialize your project. - Initialize the project as a git repository.
- Run
go get github.com/gin-gonic/gin
to install Gin dependency. - Commit and push the existing code to a GitHub repository. Then, create a new branch.
- Create
/hello
endpoint, where it should return the messageHello world!
in JSON format e.g.{ "message": "Hello world!" }
- Create
/greet/:name
endpoint, where:name
is a parameter. It should outputHello <name parameter>!
in JSON format. - Commit and push this new branch. Create a PR to
master
.
Your commit message should be GCI-<your_gci_id> message
.
Submission steps
- Your PR link
- Two screenshots showing the responses in the Postman for
/hello
endpoint and/greet/:name
endpoint. - Write on the advantages of using Go instead of other backend frameworks.
Task tags
Students who completed this task
ajey muthiah, Ali Ayad, prathamesh_m009, xuxe, riskycase, Nayan, PermissionError, Ribhav Sharma, lukasz-zbrzeski, dzejqub, CSY2002, Devanshk09, tixpro, Snigdho