mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-11 15:55:09 +00:00
43 lines
941 B
JavaScript
43 lines
941 B
JavaScript
'use strict';
|
|
|
|
define([
|
|
'react',
|
|
'react-router',
|
|
'templates/app/components/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}),
|
|
Route({
|
|
name: 'buildLog',
|
|
path: 'builds/:buildId/log',
|
|
handler: Components.BuildLog
|
|
})
|
|
)
|
|
);
|
|
|
|
Router.run(routes, Router.HistoryLocation, function(Handler) {
|
|
React.render(
|
|
React.createElement(Handler),
|
|
document.getElementById('content')
|
|
);
|
|
});
|
|
});
|