import React from 'react';
import { Route, IndexRoute } from 'react-router';

require('./favicon.ico');

import App from './containers/App';
import Home from './containers/views/Home';
import Config from './containers/views/Configuration';
import Posts from './containers/views/Posts';
import PostEdit from './containers/views/PostEdit';
import Pages from './containers/views/Pages';
import Collections from './containers/views/Collections';
import NotFound from './containers/views/NotFound';

export default (
  <Route path="/" component={App}>
    <IndexRoute component={Home}/>
    <Route path="/configuration" component={Config} />
    <Route path="/posts" component={Posts} />
    <Route path="/posts/:post" component={PostEdit} />
    <Route path="/pages" component={Pages} />
    <Route path="/collections" component={Collections} />
    <Route path="*" component={NotFound} />
  </Route>
);

import React from 'react';
import { Route, IndexRoute } from 'react-router';

import App from './containers/App';
import Configuration from './containers/views/Configuration';
import Pages from './containers/views/Pages';
import PageEdit from './containers/views/PageEdit';
import PageNew from './containers/views/PageNew';
import Collection from './containers/views/Collection';
import CollectionEdit from './containers/views/CollectionEdit';
import CollectionNew from './containers/views/CollectionNew';

import NotFound from './containers/views/NotFound';

export default (
  <Route path="/" component={App}>
    <IndexRoute component={Pages}/>
    <Route path="/configuration" component={Configuration} />
    <Route path="/pages" component={Pages} />
    <Route path="/pages/:page_id" component={PageEdit} />
    <Route path="/page/new" component={PageNew} />
    <Route path="/collections/:collection_name" component={Collection} />
    <Route path="/collections/:collection_name/:document_id" component={CollectionEdit} />
    <Route path="/collection/:collection_name/new" component={CollectionNew} /> // check collection exists
    <Route path="*" component={NotFound} />
  </Route>
);

update routes