mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 10:11:03 +00:00
- Also added linter configuration, and make linter fail on error - fixing ES6 errors and added ES6 transformer - gulp target to try local build - linted gulpfile - cant hook into gulp lint yet, because gulp does currently not support ES6 which some rules demand, since gulp cant transpile itself, we have a chicken and egg problem. - ES6 transpiler for test runner - removed old linter config - adapted editorconfig to reflect linter config
30 lines
583 B
JavaScript
30 lines
583 B
JavaScript
const page = require('page');
|
|
|
|
const AppActions = require('../actions/app-actions');
|
|
const AppStore = require('../stores/app-store');
|
|
|
|
function updateRoute() {
|
|
const state = AppStore.getAppState();
|
|
const stateUrl = JSON.stringify(state);
|
|
const dispatch = false;
|
|
|
|
page.show('/state/' + stateUrl, state, dispatch);
|
|
}
|
|
|
|
page('/', function() {
|
|
updateRoute();
|
|
});
|
|
|
|
page('/state/:state', function(ctx) {
|
|
const state = JSON.parse(ctx.params.state);
|
|
AppActions.route(state);
|
|
});
|
|
|
|
module.exports = {
|
|
getRouter: function() {
|
|
return page;
|
|
},
|
|
|
|
updateRoute: updateRoute
|
|
};
|