Skip to content

Instantly share code, notes, and snippets.

View cmelgarejo's full-sized avatar
🚀
Working from home

Christian Melgarejo cmelgarejo

🚀
Working from home
View GitHub Profile
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"
)
package utils
import (
"log"
"os"
"strconv"
)
// MustGet will return the env or panic if it is not present
func MustGet(k string) string {
./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
/go-gql-server $ chmod +x scripts/build.sh
/go-gql-server $ .scripts/build.sh
Building: gql-server
real 0m0.317s
user 0m0.531s
sys 0m0.529s
Built: gql-server size:16M
#!/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
package main
import (
"github.com/cmelgarejo/go-gql-server/pkg/server"
)
func main() {
server.Run()
}
package server
import (
"log"
"github.com/gin-gonic/gin"
"github.com/cmelgarejo/go-gql-server/internal/handlers"
)
var HOST, PORT string
$ mkdir go-gql-server
$ cd go-gql-server
/go-gql-server $
@cmelgarejo
cmelgarejo / profile.ps1
Created October 26, 2018 21:57
Agnoster-like Powershell theme
# 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'