项目作者: glinton

项目描述 :
Simple golang web app
高级语言: Go
项目地址: git://github.com/glinton/gola.git
创建时间: 2017-02-16T22:30:09Z
项目社区:https://github.com/glinton/gola

开源协议:MIT License

下载


Gola, A simple golang Hello World “full-stack” web application

Gopher created at gopherize.me

Although I’ve never been a fan of the phrase “full-stack developer” (mainly due to the ambiguity of “stack”), I threw this together from an app I am building to learn web development. It seems that it qualifies as a “full-web-stack” using a single language. I’m still not totally convinced, however, as html, javascript, and css are not go.

This can be built and run locally as follows (access in your browser at 127.0.0.1:8080):

  1. go get ./...
  2. go build
  3. ./gola

Or, if you don’t want to worry about getting a go environment installed, use nanobox and run the following, accessing in your browser at the address shown at the end):

  1. nanobox deploy dry-run

You should be greeted with “Hello world” in one of 12 languages. Refresh the page to be greeted in another.

Navigating to /requests will show you how many times you have been greeted (technically how many times the server has sent greetings in its lifetime)

TODO

  • Consider not preloading the 404 page (for development only)
  • Find image of gopher wearing sombrero
  • Make sure nanobox deploy works with this type of web app before giving it as an option