Loading Procfile +1 −1 Original line number Diff line number Diff line web: greentros web: app-backend app-backend/main.go +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 { Loading @@ -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") } app/components/version/interpolate-filter.js 0 → 100644 +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); }; }]); app/components/version/interpolate-filter_test.js 0 → 100644 +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'); })); }); }); app/components/version/version-directive.js 0 → 100644 +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
app-backend/main.go +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 { Loading @@ -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") }
app/components/version/interpolate-filter.js 0 → 100644 +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); }; }]);
app/components/version/interpolate-filter_test.js 0 → 100644 +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'); })); }); });
app/components/version/version-directive.js 0 → 100644 +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); }; }]);