Skip to content

Instantly share code, notes, and snippets.

@mbensch
Created March 24, 2016 00:12
Show Gist options
  • Select an option

  • Save mbensch/85fc9064f4ca5510bb4d to your computer and use it in GitHub Desktop.

Select an option

Save mbensch/85fc9064f4ca5510bb4d to your computer and use it in GitHub Desktop.
// Framework Imports
import 'babel-polyfill';
import { Application } from 'reductor';
import React from 'react';
import { Route, IndexRedirect } from 'react-router';
// Constants for Developmen purposes
const ENV = process.env.NODE_ENV || 'development';
const DevTools = window.devToolsExtension ? window.devToolsExtension() : f => f;
// Global Static Asset Imports
import 'static/robots.txt';
// Import all modules that you want to load here
import {
SessionModule,
LogsModule,
WorkspaceModule,
PageModule,
DashboardModule,
} from 'modules';
// Bootstrap the application
const ReductorUI = new Application();
ReductorUI
.name('Reductor')
.version('1.15.0');
// Enable DevTools in development mode
if (ENV === 'development') {
ReductorUI
.addEnhancer(DevTools)
.debug();
}
// Add Modules to the Application instance
ReductorUI
.addModule(SessionModule)
.addModule(LogsModule)
.addModule(WorkspaceModule)
.addModule(PageModule)
.addModule(DashboardModule);
// Define Routes
ReductorUI.setRoutes(
<Route>
<Route path="/" component={SessionModule.getComponent('LandingPage')} />
<Route path="/:locator" component={SessionModule.getComponent('SessionContainer')}>
<IndexRedirect to="login" />
<Route path="login" component={SessionModule.getComponent('LoginContainer')} />
<Route component={PageModule.getComponent('PageContainer')}>
{/* DO NOT CHANGE ANYTHING ABOVE THIS LINE */}
{/* All routes to your modules should go here*/}
<Route path="logs" component={LogsModule.getComponent('LogsContainer')} />
<Route path="dashboard" component={DashboardModule.getComponent('Test')} />
<Route path="workspace" component={WorkspaceModule.getComponent('Test')} />
{/* DO NOT CHANGE ANYTHING BELOW THIS LINE */}
</Route>
</Route>
</Route>
);
// Run the application
ReductorUI.run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment