Most of the files in public/ are downloaded from various sources. Here is a list of outside libraries:
- public/js/angular.min.js: Minified angular.js 1.2.9
- public/js/less.min.js: Minified less compiler, because this is not intended to be used with any type of production code. Since it's only intended to be run as a demo on a development server, it just uses the javascript client-side less compiler.
- public/js/bootstrap*.js: Bootstrap javascript files.
- public/less: Bootstrap less files.
- public/fonts: Bootstrap fonts.
- public/partials: Bootstrap html files (I wasn't paying too much attention to their contents, which might not have been a good idea ... I'll clean them up if I ever add real partials).
The main files that make up the demo are:
- Any file that ends in .go: These are the Go source files for the API.
- public/app.html: The main html file, which static.go maps all unknown paths to.
- public/js/app.js: The angular controller that handles the demo.
Pretty standard for a Go project:
- Install the Go tool
- Create a directory for Go development, e.g.
$ mkdir -p ~/dev/golang
- Set up the GOPATH environment variable to point to the above
directory, e.g.
$ export GOPATH="~/dev/golang"
- Add
$GOPATH/bin
to your $PATH:$ export PATH="$GOPATH/bin:$PATH"
- Run
go get
:$ go get github.com/nelsam/goweb_angular_demo
- Run the application:
$ PORT=5000 goweb_angular_demo
- Visit
localhost:5000
in your web browser.