package main

import (
	"log"
	"net/http"
	"os"

	"github.com/gin-gonic/gin"
)

func main() {
	p := os.Getenv("PORT")
	if p == "" {
		log.Fatal("$PORT must be set")
	}

	r := gin.Default()

	// PING test
	r.GET("/ping", func(c *gin.Context) {
		c.String(http.StatusOK, "PONG")
	})

	r.Run(":" + p)
}

package main

import (
	"log"
	"net/http"
	"os"

	"gopkg.in/mgo.v2"

	"github.com/gin-gonic/gin"
)

func main() {
	session, err := mgo.Dial("localhost")
	if err != nil {
		log.Fatalln("FATAL", err)
	}
	defer session.Close()

	p := os.Getenv("PORT")
	if p == "" {
		log.Fatal("$PORT must be set")
	}

	r := gin.Default()

	// PING test
	r.GET("/ping", func(c *gin.Context) {
		c.String(http.StatusOK, "PONG")
	})

	r.Run(":" + p)
}

Add mgo dependency for testing.
Add mgo dependency for testing.
