Skip to content

Instantly share code, notes, and snippets.

@mushfiq

mushfiq/main.go

Last active Apr 3, 2016
Embed
What would you like to do?
Golang based REST API deployed using Docker.
package main
import (
"github.com/gin-gonic/gin"
"time"
)
func rootHandler(context *gin.Context) {
current_time := time.Now()
current_time.Format("20060102150405")
context.JSON(200, gin.H{
"current_time": current_time,
})
}
func main() {
router := gin.Default()
router.GET("/", rootHandler)
router.Run()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.