Commit 0f568c1a authored by santiaago's avatar santiaago
Browse files

angularizing greentros

parent 225e2103
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
web: greentros
web: app-backend
+7 −2
Original line number Diff line number Diff line
package main

import (
	"flag"
	"fmt"
	"log"
	"net/http"
	"os"
)

var root = flag.String("root", "app", "khkjh") //"$GOPATH/src/github.com/taironas/greentros/app", "file system path")

func main() {
	http.HandleFunc("/", hello)
	//http.HandleFunc("/", hello)
	http.Handle("/", http.FileServer(http.Dir(*root))) //http.FileServer(http.Dir("static")))
	log.Println("location on " + http.Dir(*root))
	log.Println("Listening on " + os.Getenv("PORT"))
	err := http.ListenAndServe(":"+os.Getenv("PORT"), nil)
	if err != nil {
@@ -17,5 +22,5 @@ func main() {
}

func hello(res http.ResponseWriter, req *http.Request) {
	fmt.Fprintln(res, "hello, greentros")
	fmt.Fprintln(res, "hello, greentros ngg")
}
+9 −0
Original line number Diff line number Diff line
'use strict';

angular.module('myApp.version.interpolate-filter', [])

.filter('interpolate', ['version', function(version) {
  return function(text) {
    return String(text).replace(/\%VERSION\%/mg, version);
  };
}]);
+15 −0
Original line number Diff line number Diff line
'use strict';

describe('myApp.version module', function() {
  beforeEach(module('myApp.version'));

  describe('interpolate filter', function() {
    beforeEach(module(function($provide) {
      $provide.value('version', 'TEST_VER');
    }));

    it('should replace VERSION', inject(function(interpolateFilter) {
      expect(interpolateFilter('before %VERSION% after')).toEqual('before TEST_VER after');
    }));
  });
});
+9 −0
Original line number Diff line number Diff line
'use strict';

angular.module('myApp.version.version-directive', [])

.directive('appVersion', ['version', function(version) {
  return function(scope, elm, attrs) {
    elm.text(version);
  };
}]);
Loading