/**
 * @desc routes
 * @author awwwesssooooome <chengpengcp9@gmail.com>
 * @date 2015-10-12
 */

'use strict';

/**
 * Module dependencies
 */
import React from 'react';
import {Route} from 'react-router';
import App from '../app/components/App.react';
import Index from '../app/components/Index.react';
//import Stats from './components/Stats';
//import Character from './components/Character';
//import CharacterList from './components/CharacterList';
//import AddCharacter from './components/AddCharacter';

// example
//export default (
//  <Route handler={App}>
//    <Route path='/' handler={Home} />
//    <Route path='/stats' handler={Stats} />
//    <Route path='/characters/:id' handler={Character} />
//    <Route path='/add' handler={AddCharacter} />
//    <Route path=':category' handler={CharacterList}>
//      <Route path=':race' handler={CharacterList}>
//        <Route path=':bloodline' handler={CharacterList} />
//      </Route>
//    </Route>
//  </Route>
//);
export default (
    <Route handler={App}>
        <Route path='/' handler={Index} />
    </Route>
);

@@ -159,24 +159,134 @@
 om 'react';%0A
+//import %7BRouter, Route%7D from 'react-router'; // not work, but api said ok%0Aimport Router from 'react-router';%0A
 import %7BRout
@@ -305,24 +305,50 @@
 ct-router';%0A
+import swig from 'swig'; %0A
 import App f
@@ -437,30 +437,27 @@
 t';%0A
-//
+%0A
 import 
-Stats
+pkg
  from '.
 /com
@@ -456,225 +456,78 @@
 m '.
-/components/Stats';%0A//import Character from './components/Character';%0A//import CharacterList from './components/CharacterList';%0A//import AddCharacter from './components/AddCharacter';%0A%0A// example%0A//export default (%0A//
+./package.json';%0A%0Aexport default ((app) =%3E %7B%0A    let routes = (%0A      
   %3CR
@@ -546,22 +546,28 @@
 =%7BApp%7D%3E%0A
-//
+     
     
+   
 %3CRoute p
@@ -587,491 +587,338 @@
 er=%7B
-Home
+Index
 %7D /%3E%0A
-//
+    
     %3C
+/
 Route
- path='/stats' handler=%7BStats%7D /%3E%0A//    %3CRoute path='/characters/:id' handler=%7BCharacter%7D /%3E%0A//
+%3E%0A    );%0A%0A    app.use((req, res) =%3E %7B%0A  
     
-%3C
+  
 Route
- path='/add' handler=%7BAddCharacter%7D /%3E%0A//    %3CRoute path=':category' ha
+r.run(routes, req.path, (Handler) =%3E %7B%0A            let html = React.re
 nd
-l
 er
-=%7BCharacterList%7D%3E%0A//      %3CRoute path=':race' handler=%7BCharacterList%7D%3E%0A//        %3CRoute path=':bloodline' ha
+ToString(React.createElement(Handler));%0A            let page = swig.re
 nd
-l
 er
-=%7BCharacterList%7D /%3E%0A//      %3C/Route%3E%0A//    %3C/Route%3E%0A//  %3C/Route%3E%0A//);%0Aexport default (%0A    %3CRoute handler=%7BApp%7D%3E%0A        %3CRoute path='/' handler=%7BIndex%7D /%3E%0A    %3C/Route%3E%0A
+File('./app/views/index.html', %7B html: html, pkg: pkg %7D);%0A            res.send(page);%0A        %7D);%0A    %7D);%0A%7D
 );%0A

remove example