mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-01-11 20:55:09 +00:00
35 lines
823 B
JavaScript
35 lines
823 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({name: 'index', path: '/'},
|
|
Route({name: 'dashboard', path: '/', handler: Components.App}),
|
|
Route({name: 'projects', path: 'projects', handler: Components.Project.List}),
|
|
Route({name: 'build', path: 'builds/:id', handler: Components.Build.View})
|
|
)
|
|
);
|
|
|
|
Router.run(routes, Router.HistoryLocation, function(Handler) {
|
|
React.render(
|
|
template({Component: Handler, Header: Components.Header}),
|
|
document.getElementById('content')
|
|
);
|
|
});
|
|
|
|
});
|