nci/static/js/app/app.js
2015-07-11 18:15:18 +03:00

38 lines
820 B
JavaScript

'use strict';
define([
'react',
'react-router',
'templates/app/index',
'app/components/index',
'app/actions/project', 'app/actions/build'
], function(
React,
Router,
template,
Components,
ProjectActions, BuildActions
) {
var Route = React.createFactory(Router.Route),
DefaultRoute = React.createFactory(Router.DefaultRoute);
var routes = (
Route({handler: Components.App},
Route({name: 'dashboard', path: '/', handler: Components.Dashboard}),
Route({
name: 'project',
path: 'projects/:name',
handler: Components.Project.View
}),
Route({name: 'build', path: 'builds/:id', handler: Components.Build.View})
)
);
Router.run(routes, Router.HistoryLocation, function(Handler) {
React.render(
React.createElement(Handler),
document.getElementById('content')
);
});
});