GithubHelp home page GithubHelp logo

supermouseno1 / git-go-websiteskeleton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeanbza/git-go-websiteskeleton

0.0 1.0 0.0 4.15 MB

A go skeleton for websites.

License: Other

Go 67.36% HTML 32.64%

git-go-websiteskeleton's Introduction

git-go-websiteskeleton

A basic website skeleton in Go (or golang, if you prefer) that comes with the Gorilla Multiplexer for routing, glog for access and error logging, as well as jquery, bootstrap, and font-awesome for making excellent web apps.

You Will Need

  1. A go environment http://golang.org/doc/install#install
  2. Gorilla mux: go get github.com/gorilla/mux (http://www.gorillatoolkit.org/pkg/mux)
  3. glog: go get github.com/golang/glog
  4. Some basic knowledge of Go's httpd package. See the excellent gowiki tutorial at http://golang.org/doc/articles/wiki/

Installation

  1. cd $GOPATH/src
  2. git clone https://github.com/jadekler/git-go-websiteskeleton.git
  3. cd git-go-websiteskeleton
  4. go run main.go
  5. Navigate to http://localhost:8080

Note: To make it your own project, simply remove the .git file from the project and upload it into your own repository.

Logging

This project contains access and error logging. By default, these logs will be placed in your system's temp folder (on most *nix machines, this is /tmp; on mac, it's /private/var/gobbledegook). To change the log dir, simply run main with -log_dir="/path/to/dir", as in ./main -log_dir="/path/to/dir". If you decide to change the log location (which I recommend), you are in charge of cleaning your log dir periodically. The program's log library (glog) will handle max file sizes, but multiple logs will not be cleaned automatically.

Some more info on what gets captured:

  • Access logging captures each request served, logging the requestor's IP, the request method, uri, and protocol, the time requested, and the page load time.
  • Error logging captures the time, error, and a stack trace.

Note: on *nix systems, you can also set the TMPDIR environment variable to specify default output location.

What if I want to use Secure Headers?

This doesn't come with the default skeleton, but feel free to check out and implement things like http://godoc.org/github.com/kr/secureheader (which are very easy to get up and running!).

git-go-websiteskeleton's People

Contributors

bryfry avatar jeanbza avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.