diff --git a/.gitignore b/.gitignore
index d570088..dae67d0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
-node_modules/
-
+test-results/
+tmp/
+routes/
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index a67a5aa..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,23 +0,0 @@
-language: python
-
-services:
- - docker
-
-# Install non-default Docker Compose version
-before_install:
- - sudo rm /usr/local/bin/docker-compose
- - curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- - chmod +x docker-compose
- - sudo mv docker-compose /usr/local/bin
-
-install:
- - travis_retry docker build -t $DOCKER_IMAGE_NAME -f ./Dockerfile .
-
-script:
- - docker-compose -f docker-compose.yml up -d
- - docker-compose down
-
-env:
- global:
- - DOCKER_IMAGE_NAME=criticalmapsapi_web
- - DOCKER_COMPOSE_VERSION=1.12.0
diff --git a/Dockerfile b/Dockerfile
index 0dc86bb..acfd6af 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,17 +1,21 @@
-FROM node:6
+FROM golang:1.13-alpine
-RUN apt-get update -y && \
- apt-get upgrade -y && \
- apt-get install -y git GraphicsMagick
+RUN apk add --no-cache git
-RUN mkdir -p /app/
-WORKDIR /app/
+RUN mkdir -p /gopath
+ENV GOPATH=/gopath
+WORKDIR /gopath
-RUN npm install -g node-pg-migrate pg --silent
+RUN go get github.com/revel/revel && \
+ go get github.com/revel/cmd/revel && \
+ go get github.com/jinzhu/gorm && \
+ go get github.com/lib/pq && \
+ go get github.com/revel/modules/static && \
+ go get github.com/Jeffail/gabs && \
+ go get github.com/mrjones/oauth
-COPY package.json .
-RUN npm install
+COPY . /gopath/src/github.com/criticalmaps/criticalmaps-api
-COPY . .
+WORKDIR /gopath/src/github.com/criticalmaps/criticalmaps-api
-CMD npm start
+CMD ["/gopath/bin/revel", "run"]
diff --git a/README.md b/README.md
index 9eb1585..bb3043b 100644
--- a/README.md
+++ b/README.md
@@ -1,37 +1,42 @@
-# Critical Maps API
+# Welcome to Revel
-[](https://travis-ci.org/criticalmaps/criticalmaps-api)
-[](https://codeclimate.com/github/criticalmaps/criticalmaps-api)
-[](https://codeclimate.com/github/criticalmaps/criticalmaps-api/coverage)
-[](https://gemnasium.com/criticalmaps/criticalmaps-api)
+A high-productivity web framework for the [Go language](http://www.golang.org/).
-## Start development session with:
-```docker-compose -f docker-compose.dev.yml up --build```
+### Start the web server:
-### Api will be available under:
-http://localhost:3000
+ revel run myapp
-### Debugger will be available at:
-http://localhost:8080/?port=5858
+### Go to http://localhost:9000/ and you'll see:
-### phpPgAdmin is at:
-http://localhost:8082/phppgadmin/
+ "It works"
-## Migrations
+## Code Layout
-```
-docker build -t criticalmaps-db-migrations -f Dockerfile.migrations . && \
-docker run \
--v $(pwd)/migrations/:/migrations/ \
--e DATABASE_URL=postgres://bla:bla@db/criticalmaps \
-criticalmaps-db-migrations \
-up
-```
+The directory structure of a generated Revel application:
-docker exec -ti $(docker ps | grep postgres | awk '{ print $1}') /bin/bash
+ conf/ Configuration directory
+ app.conf Main app configuration file
+ routes Routes definition file
-psql -d criticalmaps -U bla
+ app/ App sources
+ init.go Interceptor registration
+ controllers/ App controllers go here
+ views/ Templates directory
-## TODO
-cors header??
+ messages/ Message files
+
+ public/ Public static assets
+ css/ CSS files
+ js/ Javascript files
+ images/ Image files
+
+ tests/ Test suites
+
+
+## Help
+
+* The [Getting Started with Revel](http://revel.github.io/tutorial/gettingstarted.html).
+* The [Revel guides](http://revel.github.io/manual/index.html).
+* The [Revel sample apps](http://revel.github.io/examples/index.html).
+* The [API documentation](https://godoc.org/github.com/revel/revel).
diff --git a/app.js b/app.js
deleted file mode 100644
index f0db95e..0000000
--- a/app.js
+++ /dev/null
@@ -1,54 +0,0 @@
-var express = require('express');
-var pgp = require('pg-promise')();
-var bodyParser = require('body-parser');
-
-
-var app = express();
-
-// connect to databases
-postgres_db = pgp({
- host: process.env.POSTGRES_HOST,
- port: process.env.POSTGRES_PORT,
- database: process.env.POSTGRES_DB,
- user: process.env.POSTGRES_USER,
- password: process.env.POSTGRES_PASSWORD,
- poolSize: 8
-});
-
-app.set('port', 80);
-
-app.use(bodyParser.json({
- limit: '5mb'
-})); // Parses req.body json from html POST
-app.use(bodyParser.urlencoded({
- limit: '5mb',
- extended: true
-})); // Parses urlencoded req.body, including extended syntax
-
-// app.configure('development', function() {
-// app.use(express.logger('dev'));
-// app.use(express.errorHandler({
-// dumpExceptions: true,
-// showStack: true
-// }));
-// });
-
-app.use('/postv2', require('./routes/index'));
-app.use('/exchange', require('./routes/index'));
-app.use('/', require('./routes/index'));
-
-app.use('/twitter', require('./routes/twitter'));
-app.use('/twitter/get.php', require('./routes/twitter'));
-
-app.use('/gallery', require('./routes/gallery'));
-
-app.use('/debug', require('./routes/debug'));
-
-
-if (!module.parent) {
- app.listen(app.get('port'), function() {
- console.log('Server started on port ' + app.get('port'));
- })
-}
-
-module.exports = app;
diff --git a/app/controllers/app.go b/app/controllers/app.go
new file mode 100644
index 0000000..465af37
--- /dev/null
+++ b/app/controllers/app.go
@@ -0,0 +1,23 @@
+package controllers
+
+import (
+ "errors"
+
+ "github.com/criticalmaps/criticalmaps-api/app/models"
+ "github.com/revel/revel"
+)
+
+type App struct {
+ *revel.Controller
+}
+
+func (c App) Index() revel.Result {
+ location := []models.Location{}
+
+ result := DB.Find(&location)
+ if result.Error != nil {
+ return c.RenderError(errors.New("Record Not Found"))
+ }
+
+ return c.RenderJSON(location)
+}
diff --git a/app/controllers/gorm.go b/app/controllers/gorm.go
new file mode 100644
index 0000000..eb8abe2
--- /dev/null
+++ b/app/controllers/gorm.go
@@ -0,0 +1,33 @@
+package controllers
+
+import (
+ "fmt"
+
+ "github.com/criticalmaps/criticalmaps-api/app/models"
+ "github.com/jinzhu/gorm"
+ "github.com/revel/revel"
+)
+
+var DB *gorm.DB
+
+func InitDB() {
+ db, err := gorm.Open("postgres",
+
+ fmt.Sprintf("host=%s port=%s user=%s password=%s dbname=%s sslmode=disable",
+ revel.Config.StringDefault("db.host", "127.0.0.1"),
+ revel.Config.StringDefault("db.port", "5432"),
+ revel.Config.StringDefault("db.username", "foo"),
+ revel.Config.StringDefault("db.password", "bar"),
+ revel.Config.StringDefault("db.database", "criticalmaps"),
+ ))
+
+ if err != nil {
+ revel.AppLog.Fatal(err.Error())
+ }
+
+ db.DB()
+
+ db.AutoMigrate(&models.Location{})
+
+ DB = db
+}
diff --git a/app/controllers/locations.go b/app/controllers/locations.go
new file mode 100644
index 0000000..1c136c4
--- /dev/null
+++ b/app/controllers/locations.go
@@ -0,0 +1,59 @@
+package controllers
+
+import (
+ "errors"
+ "fmt"
+ "time"
+
+ "regexp"
+
+ "github.com/criticalmaps/criticalmaps-api/app/models"
+ "github.com/revel/revel"
+)
+
+type Locations struct {
+ App
+}
+
+func (c Locations) List() revel.Result {
+ location := []models.Location{}
+
+ result := DB.Find(&location)
+ if result.Error != nil {
+ return c.RenderError(errors.New("Record Not Found"))
+ }
+
+ return c.RenderJSON(location)
+}
+
+func (c Locations) Post() revel.Result {
+ receivedLocation := models.Location{}
+ c.Params.BindJSON(&receivedLocation)
+
+ if receivedLocation.Device == "" || receivedLocation.Latitude == "" || receivedLocation.Longitude == "" {
+ return c.RenderError(fmt.Errorf("required parameters were left empty"))
+ }
+
+ if !c.isValidCoordinateFormat(receivedLocation.Latitude, receivedLocation.Longitude) {
+ return c.RenderError(fmt.Errorf("coordinates are not valid: %q, %q", receivedLocation.Longitude, receivedLocation.Latitude))
+ }
+
+ receivedLocation.Updated = time.Now().UTC()
+ DB.Where(models.Location{Device: receivedLocation.Device}).Assign(receivedLocation).FirstOrCreate(&receivedLocation)
+
+ return c.RenderJSON(receivedLocation)
+}
+
+func (c Locations) isValidCoordinateFormat(latitude string, longitude string) bool {
+ regex := "^[-+]?[0-9]+$"
+
+ matched, err := regexp.Match(regex, []byte(latitude))
+ if !matched || err != nil {
+ return false
+ }
+ matched, err = regexp.Match(regex, []byte(longitude))
+ if !matched || err != nil {
+ return false
+ }
+ return true
+}
diff --git a/app/controllers/locationsarchive.go b/app/controllers/locationsarchive.go
new file mode 100644
index 0000000..2f9ddeb
--- /dev/null
+++ b/app/controllers/locationsarchive.go
@@ -0,0 +1,57 @@
+package controllers
+
+import (
+ "time"
+
+ "github.com/Jeffail/gabs"
+ "github.com/revel/revel"
+)
+
+type LocationsArchive struct {
+ App
+}
+
+func (c LocationsArchive) List() revel.Result {
+ // purge old data
+ DB.Exec(`DELETE FROM locations_archive
+ WHERE created < (NOW() - INTERVAL '48 HOURS')`)
+
+ startEpoch := c.Params.Query.Get("start")
+ endEpoch := c.Params.Query.Get("end")
+
+ // retrieve archived data
+ rows, err := DB.Raw(`SELECT device, created, longitude, latitude
+ FROM locations_archive
+ WHERE
+ created BETWEEN TO_TIMESTAMP(?) AND TO_TIMESTAMP(?)`, startEpoch, endEpoch).Rows()
+
+ if err != nil {
+ return c.RenderError(err)
+ }
+
+ jsonObj := gabs.New()
+
+ defer rows.Close()
+ for rows.Next() {
+ var device string
+ var created time.Time
+ var longitude string
+ var latitude string
+
+ rows.Scan(&device, &created, &longitude, &latitude)
+
+ if !jsonObj.Exists(device) {
+ jsonObj.Array(device)
+ }
+
+ location := gabs.New()
+
+ location.Set(created.Unix(), "created")
+ location.Set(latitude, "latitude")
+ location.Set(longitude, "longitude")
+
+ jsonObj.ArrayAppend(location.Data(), device)
+ }
+
+ return c.RenderJSON(jsonObj.Data())
+}
diff --git a/app/controllers/twitter.go b/app/controllers/twitter.go
new file mode 100644
index 0000000..1720b33
--- /dev/null
+++ b/app/controllers/twitter.go
@@ -0,0 +1,52 @@
+package controllers
+
+import (
+ "encoding/json"
+ "io/ioutil"
+
+ "github.com/mrjones/oauth"
+ "github.com/revel/revel"
+)
+
+type Twitter struct {
+ App
+}
+
+var CONSUMER *oauth.Consumer
+
+func InitTwitterConsumer() {
+ CONSUMER = oauth.NewConsumer(
+ revel.Config.StringDefault("twitter.consumer_key", ""),
+ revel.Config.StringDefault("twitter.consumer_secret", ""),
+ oauth.ServiceProvider{
+ AuthorizeTokenUrl: "https://api.twitter.com/oauth/authorize",
+ RequestTokenUrl: "https://api.twitter.com/oauth/request_token",
+ AccessTokenUrl: "https://api.twitter.com/oauth/access_token",
+ },
+ )
+}
+
+func (t Twitter) List() revel.Result {
+ resp, err := CONSUMER.Get(
+ "https://api.twitter.com/1.1/search/tweets.json",
+ map[string]string{"q": "criticalmaps", "count": "100"},
+ &oauth.AccessToken{
+ Token: revel.Config.StringDefault("twitter.access_token_key", ""),
+ Secret: revel.Config.StringDefault("twitter.access_token_secret", ""),
+ })
+ if err != nil {
+ return t.RenderError(err)
+ }
+
+ defer resp.Body.Close()
+
+ respBody, err := ioutil.ReadAll(resp.Body)
+
+ marshalledJSON := map[string]interface{}{}
+ err = json.Unmarshal([]byte(respBody), &marshalledJSON)
+ if err != nil {
+ panic(err)
+ }
+
+ return t.RenderJSON(marshalledJSON)
+}
diff --git a/app/init.go b/app/init.go
new file mode 100644
index 0000000..e2d8790
--- /dev/null
+++ b/app/init.go
@@ -0,0 +1,54 @@
+package app
+
+import (
+ "github.com/criticalmaps/criticalmaps-api/app/controllers"
+ _ "github.com/jinzhu/gorm/dialects/postgres"
+ "github.com/revel/revel"
+)
+
+var (
+ // AppVersion revel app version (ldflags)
+ AppVersion string
+
+ // BuildTime revel app build-time (ldflags)
+ BuildTime string
+)
+
+func init() {
+ // Filters is the default set of global filters.
+ revel.Filters = []revel.Filter{
+ revel.PanicFilter, // Recover from panics and display an error page instead.
+ revel.RouterFilter, // Use the routing table to select the right Action
+ revel.FilterConfiguringFilter, // A hook for adding or removing per-Action filters.
+ revel.ParamsFilter, // Parse parameters into Controller.Params.
+ revel.SessionFilter, // Restore and write the session cookie.
+ revel.FlashFilter, // Restore and write the flash cookie.
+ revel.ValidationFilter, // Restore kept validation errors and save new ones from cookie.
+ revel.I18nFilter, // Resolve the requested language
+ HeaderFilter, // Add some security based headers
+ revel.InterceptorFilter, // Run interceptors around the action.
+ revel.CompressFilter, // Compress the result.
+ revel.BeforeAfterFilter, // Call the before and after filter functions
+ revel.ActionInvoker, // Invoke the action.
+ }
+
+ // Register startup functions with OnAppStart
+ // revel.DevMode and revel.RunMode only work inside of OnAppStart. See Example Startup Script
+ // ( order dependent )
+ // revel.OnAppStart(ExampleStartupScript)
+ revel.OnAppStart(controllers.InitDB)
+ revel.OnAppStart(controllers.InitTwitterConsumer)
+ // revel.OnAppStart(FillCache)
+}
+
+// HeaderFilter adds common security headers
+// There is a full implementation of a CSRF filter in
+// https://github.com/revel/modules/tree/master/csrf
+var HeaderFilter = func(c *revel.Controller, fc []revel.Filter) {
+ c.Response.Out.Header().Add("X-Frame-Options", "SAMEORIGIN")
+ c.Response.Out.Header().Add("X-XSS-Protection", "1; mode=block")
+ c.Response.Out.Header().Add("X-Content-Type-Options", "nosniff")
+ c.Response.Out.Header().Add("Referrer-Policy", "strict-origin-when-cross-origin")
+
+ fc[0](c, fc[1:]) // Execute the next filter stage.
+}
diff --git a/app/models/gallery.go b/app/models/gallery.go
new file mode 100644
index 0000000..ceafd2c
--- /dev/null
+++ b/app/models/gallery.go
@@ -0,0 +1,14 @@
+package models
+
+type Gallery struct {
+ ID uint `gorm:"primary_key"`
+ Ip string
+ Latitude int
+ Longitude int
+ Thumbnail []byte
+ Image []byte
+}
+
+func (Gallery) TableName() string {
+ return "gallery"
+}
diff --git a/app/models/location.go b/app/models/location.go
new file mode 100644
index 0000000..d67b44f
--- /dev/null
+++ b/app/models/location.go
@@ -0,0 +1,16 @@
+package models
+
+import "time"
+
+type Location struct {
+ ID uint `json:"id" gorm:"primary_key"`
+ Updated time.Time `json:"updated"`
+ Device string `json:"device"`
+ Color string `json:"color"`
+ Longitude string `json:"longitude"`
+ Latitude string `json:"latitude"`
+}
+
+func (Location) TableName() string {
+ return "locations"
+}
diff --git a/app/routes/routes.go b/app/routes/routes.go
new file mode 100644
index 0000000..3496bc6
--- /dev/null
+++ b/app/routes/routes.go
@@ -0,0 +1,155 @@
+// GENERATED CODE - DO NOT EDIT
+// This file provides a way of creating URL's based on all the actions
+// found in all the controllers.
+package routes
+
+import "github.com/revel/revel"
+
+
+type tApp struct {}
+var App tApp
+
+
+func (_ tApp) Index(
+ ) string {
+ args := make(map[string]string)
+
+ return revel.MainRouter.Reverse("App.Index", args).URL
+}
+
+
+type tLocations struct {}
+var Locations tLocations
+
+
+func (_ tLocations) List(
+ ) string {
+ args := make(map[string]string)
+
+ return revel.MainRouter.Reverse("Locations.List", args).URL
+}
+
+func (_ tLocations) Post(
+ ) string {
+ args := make(map[string]string)
+
+ return revel.MainRouter.Reverse("Locations.Post", args).URL
+}
+
+
+type tLocationsArchive struct {}
+var LocationsArchive tLocationsArchive
+
+
+func (_ tLocationsArchive) List(
+ ) string {
+ args := make(map[string]string)
+
+ return revel.MainRouter.Reverse("LocationsArchive.List", args).URL
+}
+
+
+type tTwitter struct {}
+var Twitter tTwitter
+
+
+func (_ tTwitter) List(
+ ) string {
+ args := make(map[string]string)
+
+ return revel.MainRouter.Reverse("Twitter.List", args).URL
+}
+
+
+type tStatic struct {}
+var Static tStatic
+
+
+func (_ tStatic) Serve(
+ prefix string,
+ filepath string,
+ ) string {
+ args := make(map[string]string)
+
+ revel.Unbind(args, "prefix", prefix)
+ revel.Unbind(args, "filepath", filepath)
+ return revel.MainRouter.Reverse("Static.Serve", args).URL
+}
+
+func (_ tStatic) ServeDir(
+ prefix string,
+ filepath string,
+ ) string {
+ args := make(map[string]string)
+
+ revel.Unbind(args, "prefix", prefix)
+ revel.Unbind(args, "filepath", filepath)
+ return revel.MainRouter.Reverse("Static.ServeDir", args).URL
+}
+
+func (_ tStatic) ServeModule(
+ moduleName string,
+ prefix string,
+ filepath string,
+ ) string {
+ args := make(map[string]string)
+
+ revel.Unbind(args, "moduleName", moduleName)
+ revel.Unbind(args, "prefix", prefix)
+ revel.Unbind(args, "filepath", filepath)
+ return revel.MainRouter.Reverse("Static.ServeModule", args).URL
+}
+
+func (_ tStatic) ServeModuleDir(
+ moduleName string,
+ prefix string,
+ filepath string,
+ ) string {
+ args := make(map[string]string)
+
+ revel.Unbind(args, "moduleName", moduleName)
+ revel.Unbind(args, "prefix", prefix)
+ revel.Unbind(args, "filepath", filepath)
+ return revel.MainRouter.Reverse("Static.ServeModuleDir", args).URL
+}
+
+
+type tTestRunner struct {}
+var TestRunner tTestRunner
+
+
+func (_ tTestRunner) Index(
+ ) string {
+ args := make(map[string]string)
+
+ return revel.MainRouter.Reverse("TestRunner.Index", args).URL
+}
+
+func (_ tTestRunner) Suite(
+ suite string,
+ ) string {
+ args := make(map[string]string)
+
+ revel.Unbind(args, "suite", suite)
+ return revel.MainRouter.Reverse("TestRunner.Suite", args).URL
+}
+
+func (_ tTestRunner) Run(
+ suite string,
+ test string,
+ ) string {
+ args := make(map[string]string)
+
+ revel.Unbind(args, "suite", suite)
+ revel.Unbind(args, "test", test)
+ return revel.MainRouter.Reverse("TestRunner.Run", args).URL
+}
+
+func (_ tTestRunner) List(
+ ) string {
+ args := make(map[string]string)
+
+ return revel.MainRouter.Reverse("TestRunner.List", args).URL
+}
+
+
diff --git a/app/tmp/main.go b/app/tmp/main.go
new file mode 100644
index 0000000..e55f24b
--- /dev/null
+++ b/app/tmp/main.go
@@ -0,0 +1,25 @@
+// GENERATED CODE - DO NOT EDIT
+// This file is the main file for Revel.
+// It registers all the controllers and provides details for the Revel server engine to
+// properly inject parameters directly into the action endpoints.
+package main
+
+import (
+ "flag"
+ "github.com/criticalmaps/criticalmaps-api/app/tmp/run"
+ "github.com/revel/revel"
+)
+
+var (
+ runMode *string = flag.String("runMode", "", "Run mode.")
+ port *int = flag.Int("port", 0, "By default, read from app.conf")
+ importPath *string = flag.String("importPath", "", "Go Import Path for the app.")
+ srcPath *string = flag.String("srcPath", "", "Path to the source root.")
+
+)
+
+func main() {
+ flag.Parse()
+ revel.Init(*runMode, *importPath, *srcPath)
+ run.Run(*port)
+}
diff --git a/app/tmp/run/run.go b/app/tmp/run/run.go
new file mode 100644
index 0000000..15df27a
--- /dev/null
+++ b/app/tmp/run/run.go
@@ -0,0 +1,179 @@
+// GENERATED CODE - DO NOT EDIT
+// This file is the run file for Revel.
+// It registers all the controllers and provides details for the Revel server engine to
+// properly inject parameters directly into the action endpoints.
+package run
+
+import (
+ "reflect"
+ "github.com/revel/revel"
+ _ "github.com/criticalmaps/criticalmaps-api/app"
+ controllers "github.com/criticalmaps/criticalmaps-api/app/controllers"
+ tests "github.com/criticalmaps/criticalmaps-api/tests"
+ controllers0 "github.com/revel/modules/static/app/controllers"
+ _ "github.com/revel/modules/testrunner/app"
+ controllers1 "github.com/revel/modules/testrunner/app/controllers"
+ "github.com/revel/revel/testing"
+)
+
+var (
+ // So compiler won't complain if the generated code doesn't reference reflect package...
+ _ = reflect.Invalid
+)
+
+// Register and run the application
+func Run(port int) {
+ Register()
+ revel.Run(port)
+}
+
+// Register all the controllers
+func Register() {
+ revel.AppLog.Info("Running revel server")
+
+ revel.RegisterController((*controllers.App)(nil),
+ []*revel.MethodType{
+ &revel.MethodType{
+ Name: "Index",
+ Args: []*revel.MethodArg{
+ },
+ RenderArgNames: map[int][]string{
+ },
+ },
+
+ })
+
+ revel.RegisterController((*controllers.Locations)(nil),
+ []*revel.MethodType{
+ &revel.MethodType{
+ Name: "List",
+ Args: []*revel.MethodArg{
+ },
+ RenderArgNames: map[int][]string{
+ },
+ },
+ &revel.MethodType{
+ Name: "Post",
+ Args: []*revel.MethodArg{
+ },
+ RenderArgNames: map[int][]string{
+ },
+ },
+
+ })
+
+ revel.RegisterController((*controllers.LocationsArchive)(nil),
+ []*revel.MethodType{
+ &revel.MethodType{
+ Name: "List",
+ Args: []*revel.MethodArg{
+ },
+ RenderArgNames: map[int][]string{
+ },
+ },
+
+ })
+
+ revel.RegisterController((*controllers.Twitter)(nil),
+ []*revel.MethodType{
+ &revel.MethodType{
+ Name: "List",
+ Args: []*revel.MethodArg{
+ },
+ RenderArgNames: map[int][]string{
+ },
+ },
+
+ })
+
+ revel.RegisterController((*controllers0.Static)(nil),
+ []*revel.MethodType{
+ &revel.MethodType{
+ Name: "Serve",
+ Args: []*revel.MethodArg{
+ &revel.MethodArg{Name: "prefix", Type: reflect.TypeOf((*string)(nil)) },
+ &revel.MethodArg{Name: "filepath", Type: reflect.TypeOf((*string)(nil)) },
+ },
+ RenderArgNames: map[int][]string{
+ },
+ },
+ &revel.MethodType{
+ Name: "ServeDir",
+ Args: []*revel.MethodArg{
+ &revel.MethodArg{Name: "prefix", Type: reflect.TypeOf((*string)(nil)) },
+ &revel.MethodArg{Name: "filepath", Type: reflect.TypeOf((*string)(nil)) },
+ },
+ RenderArgNames: map[int][]string{
+ },
+ },
+ &revel.MethodType{
+ Name: "ServeModule",
+ Args: []*revel.MethodArg{
+ &revel.MethodArg{Name: "moduleName", Type: reflect.TypeOf((*string)(nil)) },
+ &revel.MethodArg{Name: "prefix", Type: reflect.TypeOf((*string)(nil)) },
+ &revel.MethodArg{Name: "filepath", Type: reflect.TypeOf((*string)(nil)) },
+ },
+ RenderArgNames: map[int][]string{
+ },
+ },
+ &revel.MethodType{
+ Name: "ServeModuleDir",
+ Args: []*revel.MethodArg{
+ &revel.MethodArg{Name: "moduleName", Type: reflect.TypeOf((*string)(nil)) },
+ &revel.MethodArg{Name: "prefix", Type: reflect.TypeOf((*string)(nil)) },
+ &revel.MethodArg{Name: "filepath", Type: reflect.TypeOf((*string)(nil)) },
+ },
+ RenderArgNames: map[int][]string{
+ },
+ },
+
+ })
+
+ revel.RegisterController((*controllers1.TestRunner)(nil),
+ []*revel.MethodType{
+ &revel.MethodType{
+ Name: "Index",
+ Args: []*revel.MethodArg{
+ },
+ RenderArgNames: map[int][]string{
+ 76: []string{
+ "testSuites",
+ },
+ },
+ },
+ &revel.MethodType{
+ Name: "Suite",
+ Args: []*revel.MethodArg{
+ &revel.MethodArg{Name: "suite", Type: reflect.TypeOf((*string)(nil)) },
+ },
+ RenderArgNames: map[int][]string{
+ },
+ },
+ &revel.MethodType{
+ Name: "Run",
+ Args: []*revel.MethodArg{
+ &revel.MethodArg{Name: "suite", Type: reflect.TypeOf((*string)(nil)) },
+ &revel.MethodArg{Name: "test", Type: reflect.TypeOf((*string)(nil)) },
+ },
+ RenderArgNames: map[int][]string{
+ 125: []string{
+ },
+ },
+ },
+ &revel.MethodType{
+ Name: "List",
+ Args: []*revel.MethodArg{
+ },
+ RenderArgNames: map[int][]string{
+ },
+ },
+
+ })
+
+ revel.DefaultValidationKeys = map[string]map[int]string{
+ }
+ testing.TestSuites = []interface{}{
+ (*tests.LocationTest)(nil),
+ (*tests.AppTest)(nil),
+ }
+}
diff --git a/app/views/App/Index.html b/app/views/App/Index.html
new file mode 100644
index 0000000..7d3043a
--- /dev/null
+++ b/app/views/App/Index.html
@@ -0,0 +1,40 @@
+{{set . "title" "Home"}}
+{{template "header.html" .}}
+
+It works!1
+ {{.result}}
+
+
|
+ {{ .ID }}
+ |
+
+ |
+ + delete + | +
+ {{.Description}} +
+ {{end}} +{{end}} + + diff --git a/app/views/errors/500.html b/app/views/errors/500.html new file mode 100644 index 0000000..0cef4de --- /dev/null +++ b/app/views/errors/500.html @@ -0,0 +1,16 @@ + + + ++ This exception has been logged. +
+ {{end}} + + diff --git a/app/views/flash.html b/app/views/flash.html new file mode 100644 index 0000000..1c764c0 --- /dev/null +++ b/app/views/flash.html @@ -0,0 +1,18 @@ +{{if .flash.success}} +