• Stars
    star
    4,228
  • Rank 10,164 (Top 0.3 %)
  • Language
    Go
  • License
    MIT License
  • Created about 11 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Live reload utility for Go web servers

gin wercker status

gin is a simple command line utility for live-reloading Go web applications. Just run gin in your app directory and your web app will be served with gin as a proxy. gin will automatically recompile your code when it detects a change. Your app will be restarted the next time it receives an HTTP request.

gin adheres to the "silence is golden" principle, so it will only complain if there was a compiler error or if you succesfully compile after an error.

Installation

Assuming you have a working Go environment and GOPATH/bin is in your PATH, gin is a breeze to install:

go install github.com/codegangsta/gin@latest

Then verify that gin was installed correctly:

gin help

Basic usage

gin run main.go

Options

   --laddr value, -l value       listening address for the proxy server
   --port value, -p value        port for the proxy server (default: 3000)
   --appPort value, -a value     port for the Go web server (default: 3001)
   --bin value, -b value         name of generated binary file (default: "gin-bin")
   --path value, -t value        Path to watch files from (default: ".")
   --build value, -d value       Path to build files from (defaults to same value as --path)
   --excludeDir value, -x value  Relative directories to exclude
   --immediate, -i               run the server immediately after it's built
   --all                         reloads whenever any file changes, as opposed to reloading only on .go file change
   --godep, -g                   use godep when building
   --buildArgs value             Additional go build arguments
   --certFile value              TLS Certificate
   --keyFile value               TLS Certificate Key
   --logPrefix value             Setup custom log prefix
   --notifications               enable desktop notifications
   --help, -h                    show help
   --version, -v                 print the version

Supporting Gin in Your Web app

gin assumes that your web app binds itself to the PORT environment variable so it can properly proxy requests to your app. Web frameworks like Martini do this out of the box.

Using flags?

When you normally start your server with flags if you want to override any of them when running gin we suggest you instead use github.com/namsral/flag as explained in this post

If you want to still use the standard flag package but support environment variables, you might want to try github.com/peak6/envflag.

More Repositories

1

inject

Dependency injection for go
Go
985
star
2

martini-contrib

This project has moved!
Go
278
star
3

bwag

Source code for the book "Building Web Apps with Go"
Go
197
star
4

essential-go

Go
174
star
5

caddy-nats

A caddy module that adds support for nats.io pub/sub and request/reply
Go
85
star
6

mixer

Classy HTTP Handlers in Go
Go
57
star
7

dotfiles

Jeremy's dotfiles
Shell
53
star
8

controller

Lightweight Web Controllers in Go
Go
27
star
9

envy

General purpose environment bootstrapper
Go
25
star
10

go-advent-martini

Example project for the Go Advent Martini post
Go
22
star
11

mixology

A small, idiomatic http routing library for Go
Go
17
star
12

attr_inject

Elegant dependency injection in ruby
Ruby
16
star
13

schema_registry

A Bare bones and barely working schema registry for NATS
Go
9
star
14

pompom

Go
6
star
15

codegangsta.github.io

Rants and raves from a certified G
Astro
5
star
16

hip

A console buddy for your http requests.
Go
5
star
17

Astroneer

A mod for Starfield that puts you in the shoes of a freelance ship designer.
CUE
4
star
18

confab

Anonymized email service
Go
4
star
19

context-helpers

Go
4
star
20

goget

Serving up go package versions since 2014
Go
4
star
21

gophercon_2023_workshop

Go
3
star
22

PBTriggers

A simple but powerful trigger implementation for Pushbutton Engine
ActionScript
3
star
23

ck3_language_server

A Language Server Protocol (LSP) implementation of the Paradox interactive scripting language for Crusader Kings 3
Go
2
star
24

viewcontroller

Go
2
star
25

deck

Slide decks for presentations and workshops
MDX
2
star
26

ImbueSharp

A Simple dependency injection system for C#
C#
2
star
27

imbue.js

Dead simple dependency injection for javascript
JavaScript
2
star
28

alfred-teamocil

A teamocil launcher for Alfred
Ruby
2
star
29

negroni-docker-test

Go
1
star
30

MetaUtil

AS3 utility for easily processing metadata
ActionScript
1
star
31

s3_thumbnail

Ruby
1
star
32

Budgey

iPhone app using the Fiscus API
Objective-C
1
star
33

kubecon22

Kubecon 2022 slides and example
1
star
34

spotify

Go bindings for libspotify
Go
1
star
35

billboard

Cool terminal display for things like time and stats
C
1
star
36

firekeeper

TypeScript
1
star
37

nats-todo

TypeScript
1
star
38

nats-trivia

TypeScript
1
star