Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
82 lines (64 sloc) 2.18 KB
// Copyright (c) 2013, 2014 Akamai Technologies, Inc.
// Package main calls the atlas web package.
// The web package defines the web UI and controllers.
// The main package ties the other packages together and
// configures them via command-line flags.
package main
import (
// htmlPath tells the web controller where to look for
// HTML templates to render.
var htmlPath = flag.String("html", "html/", "path to atlas html templates")
// staticPath tells the web controller where to look for non-template static
// assets
var staticPath = flag.String("static", "static/", "path to atlas static assets")
// staticRoot tells the web controller what URL prefix to discard
var staticRoot = flag.String("staticroot", "static", "static app url prefix")
// chartsRoot tells the web controller what URL prefix to discard
var chartsRoot = flag.String("chartsroot", "charts", "charts app url prefix")
// chartsPath tells us where to look for charts to render
var chartsPath = flag.String("charts", "charts/", "path to atlas charts")
// etherpadApiUrlStr tells us where to access etherpads for chart editing
var etherpadApiUrlStr = flag.String("etherpadApiUrl", "http://localhost:9001/api", "etherpad API url")
// etherpadApiSecretPath tells us where to look for the etherpad API key
var etherpadApiSecretPath = flag.String("etherpadApiSecretPath", "eplite/APIKEY.txt", "path to the etherpad API secret")
func main() {
defer glog.Flush()
go func() {
for {
etherpadApiSecretRaw, err := ioutil.ReadFile(*etherpadApiSecretPath)
if err != nil {
etherpadApiSecret := strings.Trim(string(etherpadApiSecretRaw), " \t\n")
etherpadApiUrl, err := url.Parse(*etherpadApiUrlStr)
if err != nil {
web := &web.App{
HtmlPath: *htmlPath,
StaticPath: *staticPath,
StaticRoot: *staticRoot,
ChartsRoot: *chartsRoot,
ChartsPath: *chartsPath,
EtherpadApiUrl: etherpadApiUrl,
EtherpadApiSecret: etherpadApiSecret,