Skip to content

Starting platform for a Golang project with Gin webframework that pulls data from an external API and caches the result. (includes responsive template with Bootstrap)

License

Notifications You must be signed in to change notification settings

pyrrolizin/gin-api-request

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to Gin-api-request 👋

Version License: MIT

This project is a starting platform for a Golang project with Gin webframework that pulls data from an external API and caches the result. The project includes a responsive Bootstrap template.

✨ Demo (OpenWeatherMap-Api - Current weather in Stuttgart, Germany)

tbd

screenshot of the demo application

Prerequisit

  • golang > 1.18

Installation

go install

Environment varaibles

You can set the following environment variables:

NAME required Comment
API_KEY yes You can get your own free OpenWeatherApi key on this website: https://home.openweathermap.org/users/sign_up
HOST yes Listening on given ip adress (default: "" maps to 0.0.0.0)
PORT yes Listening on given port (default: 8080)

You can either set the environment variables or use the .env file: Make your own copy of the .env file and specify the .env and add the keys.

cp ./.env_default ./.env

Learn more about the OpenWeatherMap API: https://openweathermap.org/api

Getting Started

First, run the development server:

go run main.go

Open http://localhost:8080 with your browser to see the result.

compile and start from source

go build main.go
./main

About

Starting platform for a Golang project with Gin webframework that pulls data from an external API and caches the result. (includes responsive template with Bootstrap)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published