Skip to content

goboilerplates/micro-graphql

Repository files navigation

Boilerplate for GraphQL Microservice in Go

Build Status codecov Go Report Card GoDoc License

Features

  • GraphQL API
  • Middlewares (cors, gzip and static)
  • CI with Travis
  • Docker Build

Installation

Get the micro-graphql repository

go get github.com/goboilerplates/micro-graphql

cd echo $GOPATH/src/github.com/goboilerplates/micro-graphql

And install dependencies

go get -u github.com/golang/dep/cmd/dep

dep ensure

Running the tests

Run all tests

go test ./...

Or run all tests with coverage

bash script/coverage.sh

Build and Run

Run main.go

bash script/Run.sh
# serve at localhost:9000

Build and run native binary

bash script/Build.sh

./micro-graphql.out

Build native binary for multiple platforms (darwin, windows and linux)

bash script/BuildMulti.sh

Environment variables

    # enable production mode, default is true
    env GBP_PROMODE=false

Docker support

Build docker image

bash script/Dockerbuild.sh

Run docker container

docker run -d --name micro-graphql -p 9000:9000 goboilerplates/micro-graphql

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Boilerplate for GraphQL Microservice in Go

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published