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" | |
"github.com/cmelgarejo/go-gql-server/pkg/utils" | |
) |
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 utils | |
import ( | |
"log" | |
"os" | |
"strconv" | |
) | |
// MustGet will return the env or panic if it is not present | |
func MustGet(k string) string { |
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
./build/gql-server | |
[GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached. | |
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production. | |
- using env: export GIN_MODE=release | |
- using code: gin.SetMode(gin.ReleaseMode) | |
[GIN-debug] GET /ping --> github.com/cmelgarejo/go-gql-server/internal/handlers.Ping.func1 (3 handlers) | |
2019/07/13 00:00:00 Running @ http://localhost:7777/gql | |
[GIN-debug] Listening and serving HTTP on :7777 |
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
/go-gql-server $ chmod +x scripts/build.sh |
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
/go-gql-server $ .scripts/build.sh | |
Building: gql-server | |
real 0m0.317s | |
user 0m0.531s | |
sys 0m0.529s | |
Built: gql-server size:16M |
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
#!/bin/sh | |
srcPath="cmd" | |
pkgFile="main.go" | |
outputPath="build" | |
app="gql-server" | |
output="$outputPath/$app" | |
src="$srcPath/$app/$pkgFile" | |
printf "\nBuilding: $app\n" | |
time go build -o $output $src |
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 main | |
import ( | |
"github.com/cmelgarejo/go-gql-server/pkg/server" | |
) | |
func main() { | |
server.Run() | |
} |
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 |
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
$ mkdir go-gql-server | |
$ cd go-gql-server | |
/go-gql-server $ |
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
# Author: vhanla, modded by: cmelgarejo | |
# original source: https://gist.github.com/vhanla/da6c061591f419be74e60c7cc09b16b5#file-profile-ps1 | |
#Force coloring of git and npm commands | |
$env:TERM = "cygwin" | |
$env:TERM = "FRSX" | |
$env:TERM = "msys" | |
$global:foregroundColor = 'white' |