~humaid/ns2-trace-go

d8647553e311a3a3a675879ffa45d87fc32e5410 — Humaid AlQassimi 1 year, 9 months ago 6b3a62c
Support Heroku
3 files changed, 20 insertions(+), 1 deletions(-)

A Procfile
A heroku.yml
M main.go
A Procfile => Procfile +1 -0
@@ 0,0 1,1 @@
web: ns2-trace-go

A heroku.yml => heroku.yml +8 -0
@@ 0,0 1,8 @@
# https://devcenter.heroku.com/articles/heroku-yml-build-manifest
# Officially unsupported, but works.
build:
  languages:
    - go

run:
  web: ns2-trace-go

M main.go => main.go +11 -1
@@ 8,8 8,11 @@ import (
	chart "github.com/wcharczuk/go-chart"
	"gopkg.in/macaron.v1"
	"html/template"
	"log"
	"math/rand"
	"mime/multipart"
	"net/http"
	"os"
	"sort"
	"strconv"
)


@@ 23,6 26,12 @@ type Analysis struct {
}

func main() {
	port := "4000"

	if os.Getenv("PORT") != "" {
		port = os.Getenv("PORT")
	}

	Analysises = make(map[string]Analysis)
	m := macaron.Classic()
	m.Use(macaron.Renderer())


@@ 146,7 155,8 @@ func main() {
			ctx.HTML(200, "jitter")
		})
	})
	m.Run()
	log.Println("Running on 0.0.0.0:" + port)
	log.Println(http.ListenAndServe("0.0.0.0:"+port, m))
}

// SubmitForm holds the POST submission form for uploading the trace file.