Skip to content

Golang REST API example that provides a JSON with details about countries.

License

Notifications You must be signed in to change notification settings

jeammyb/rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

REST API Sample in GO

Simple Golang REST API example that provides a JSON with details about countries. It consumes the data from the API provided by https://restcountries.eu.

Run application

Go to the main folder and execute the following commands:

go build
./rest-api

Build Docker image

make build

Run Docker container

make run

Example

Format: http://localhost:8080/api/country/{country_name}

http://localhost:8080/api/country/guatemala

Output:

[
    {
    name: "Guatemala",
    capital: "Guatemala City",
    region: "Americas",
    subregion: "Central America",
    population: 16176133
    }
]

About

Golang REST API example that provides a JSON with details about countries.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published