bitly/nsq — pull request #406 by crossjam (2014-07-16 12:58:55+00:00)
Title: issue #405 - nsqadmin: Adapting bootstrap/jquery resources for behind a firewall

Proposed implementation for nsq issue #405

Attempts to solve the bootstrap/jquery external dependency behind a firewall by embedding the assets within the nsqadmin binary and serving them through the embedded http server. General principles/approach:
1. Implement a -use-embedded-assets command line option
2. If the option is off, nsqadmin should behave exactly like stock from master
3. Use go-bindata, https://github.com/jteeuwen/go-bindata, to generate source for embedding assets. There's some minor complication in that the templates refer to two different jquery versions, and some of the bootstrap code has embedded refs that need to be resolved
4. Minimize changes to current templates by monkeypatching js.html.go and header.html.go in the template map

Best way to see in action is to invoke nsqadmin with -use-embedded-assets and use developer tools in Firefox or Chrome to watch the requests.