• Create the heroku database

$ heroku addons:create heroku-postgresql:hobby-dev
Creating heroku-postgresql:hobby-dev on ⬢ go-getting-started... free
Created postgresql-curved-22223 as DATABASE_URL
Database has been created and is available
 ! This database is empty. If upgrading, you can transfer
 ! data from another database with pg:copy
Use heroku addons:docs heroku-postgresql to view documentation


package main

import (

	HerokuEchoIpDashboard ""
	re ""

func main() {
	e := echo.New()
	HerokuEchoIpDashboard.HerokuEchoIpDashboard(e) // init the dashboard

	e.GET("/", func(c echo.Context) error {
		re.Requester(c.Scheme() + "://" + c.Request().Host) // This is going to count all the visitors of "/"
		//return c.File("public/index.html") // Static file
		//return c.String(http.StatusOK, "Hello, World!") // a hello world

	port := os.Getenv("PORT")

	if port == "" {
		log.Println("The port to use is not declared, using port 8080")

		port = "8080"
	e.Logger.Fatal(e.Start(":" + port))


Note: The static files are serving in “herokudashboard/herokudashboard/public”


  • Test everything with Linux/MacOS

❯ DATABASE_URL=postgres://xxxx go test # Note: You get the postgres url with `heroku config -a app_name`


	e.Static("/dashboard", "src/public") // The fronted of dashboard
	e.POST("/u", controllers.UpdateData) // the route where it post the ip
	e.GET("/ip", controllers.GetIp) // the route of where you get the current ip
	e.GET("/ip/all", controllers.ReturnIps) // all the data of the database


  • Authentication

  • A better fronted


View Github