Created
July 14, 2019 00:06
-
-
Save cmelgarejo/b9689214888d3d8ae74bcbca5a86c508 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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