Skip to content

Instantly share code, notes, and snippets.

@cmelgarejo
Created July 14, 2019 00:06
Show Gist options
  • Save cmelgarejo/b9689214888d3d8ae74bcbca5a86c508 to your computer and use it in GitHub Desktop.
Save cmelgarejo/b9689214888d3d8ae74bcbca5a86c508 to your computer and use it in GitHub Desktop.
package server
import (
"log"
"github.com/gin-gonic/gin"
"github.com/cmelgarejo/go-gql-server/internal/handlers"
)
var HOST, PORT string
func init() {
HOST = "localhost"
PORT = "7777"
}
// Run web server
func Run() {
r := gin.Default()
// Setup routes
r.GET("/ping", handlers.Ping())
log.Println("Running @ http://" + HOST + ":" + PORT )
log.Fatalln(r.Run(HOST + ":" + PORT))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment