This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
class Item extends Component { | |
constructor(props, context) { | |
super(props, context); | |
} | |
render() { | |
const {params} = this.props; | |
return ( | |
<div>Item: {params.item}</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
/** | |
* Created by mobinni on 07/12/15. | |
*/ | |
require("babel/register")({ | |
ignore: /node_modules/ | |
}); | |
// Browser variable declaration should be ignored by server | |
delete process.env.BROWSER; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const env = process.env.NODE_ENV || 'DEVELOPMENT'; | |
// set env variable | |
const hasSSREnabled = (process.env.SSR || process.argv[2] === 'ssr') || false; | |
export default { | |
name: env, | |
isProduction: env === 'PRODUCTION', | |
isDevelopment: env === 'DEVELOPMENT', | |
ssrEnabled: hasSSREnabled |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import env from './environment'; | |
export default { | |
env | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import WebPack from 'webpack'; | |
import path from 'path'; | |
import fs from 'fs'; | |
import utils from '../utils'; | |
import {StringDecoder} from 'string_decoder'; | |
import webpackDevMiddleware from 'webpack-dev-middleware'; | |
import HotReload from 'webpack-hot-middleware'; | |
let webpackConfig = require( | |
`${__dirname}/../../webpack/webpack.${utils.env.isProduction ? 'prod' : 'dev'}.js` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by mobinni on 08/12/15. | |
*/ | |
import webpack from './webpack'; | |
import { match } from 'react-router'; | |
import createLocation from 'history/lib/createLocation'; | |
import {env} from '../utils'; | |
import {renderEngine} from '../engines'; | |
import routes from '../../app/scripts/routes'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {RoutingContext} from 'react-router'; | |
import ejs from 'ejs'; | |
import React from 'react'; | |
import ReactDOMServer from 'react-dom/server'; | |
const _renderComponents = (props) => { | |
return ReactDOMServer.renderToString( | |
<RoutingContext {...props} /> | |
); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── app | |
│ ├── images | |
│ ├── index.html | |
│ ├── lib | |
│ │ ├── index.js | |
│ │ ├── middleware | |
│ │ ├── modules | |
│ │ │ ├── feed | |
│ │ │ │ ├── actions.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import actions from './actions'; | |
import reducers from './reducers'; | |
export default (config) => { | |
return { | |
actions: actions(config), | |
reducers, | |
name: 'feed' | |
}; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function (config) { | |
return { | |
loadFeeds() { | |
return { type: 'get', payload: ['feed 1', 'feed 2', 'feed 3'] } | |
} | |
} | |
} |