Example #1
0
const app = express();

app.use(compression());

app.use(bodyParser.json());
app.use(express.static(__dirname + '/public'));

if (isDeveloping) {
  const compiler = webpack(config);

  app.use(webpackMiddleware(compiler, {
    publicPath: config.output.publicPath,
    contentBase: 'src',
    stats: {
      colors: true,
      hash: false,
      timings: true,
      chunks: true,
      chunkModules: false,
      modules: false
    }
  }));

  app.use(webpackHotMiddleware(compiler));

  app.listen(port, function onStart(err) {
    if (err) {
      console.log(err);
    }
    console.info('==> 🌎 Listening on port ' + port);
  });
} else {
Example #2
0
 */
browserSync.init({
  server: {
    baseDir: __dirname,

    routes: {
      '/lib': path.join(__dirname, '../node_modules')
    },

    middleware: [
      webpackDevMiddleware(bundler, {
        // IMPORTANT: dev middleware can't access config, so we should
        // provide publicPath by ourselves
        publicPath: webpackConfig.output.publicPath,

        // pretty colored output
        stats: {colors: true}

        // for other settings see
        // http://webpack.github.io/docs/webpack-dev-middleware.html
      }),

      // bundler should be the same as above
      webpackHotMiddleware(bundler)
    ]
  },

  // no need to watch '*.js' here, webpack will take care of it for us,
  // including full page reloads if HMR won't work
  files: [
    '**/*.html'
Example #3
0
var express = require('express');
var path = require('path');
var config = require('../webpack.config.js');
var webpack = require('webpack');
var webpackDevMiddleware = require('webpack-dev-middleware');
var webpackHotMiddleware = require('webpack-hot-middleware');
var fs = require('fs');
var bodyParser = require('body-parser');


var app = express();

var compiler = webpack(config);

app.use(webpackDevMiddleware(compiler, {noInfo: true, publicPath: config.output.publicPath}));
app.use(webpackHotMiddleware(compiler));


app.use(express.static('./dist'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));



var COMMENTS_FILE = path.join(__dirname, './comments.json');

app.get('/api/comments', function(req, res) {
	debugger
  fs.readFile(COMMENTS_FILE, function(err, data) {
  	console.log(COMMENTS_FILE);
    if (err) {
Example #4
0
'use strict';

var express = require('express');
var webpackDevMiddleware = require('webpack-dev-middleware');
var webpack = require('webpack');
var config = require('./webpack.config');
var CONF = require('./config');

var app = express();

var compiler = webpack(config);

app.use(webpackDevMiddleware(compiler, {
    noInfo: false,
    publicPath: config.output.publicPath,
    stats: {
        colors: true
    }
}));

app.use(express.static(CONF.BASE_PATH));

app.listen(8000, () => {
    console.info('Server listening on http://localhost:8000, Ctrl+C to stop');
});
if (__DEV__) {
	const webpack              = require('webpack')
	const webpackDevMiddleware = require('webpack-dev-middleware')
	const webpackHotMiddleware = require('webpack-hot-middleware')
	const devConfig            = require('./../../webpack.config')

	const compiler = webpack(devConfig)
	const wdm      = webpackDevMiddleware(compiler, {
		publicPath: devConfig.output.publicPath,
		hot: true,
		historyApiFallback: true,
		headers: {
			'Access-Control-Allow-Origin': '*'
		},
		stats: {
			colors: true,
			hash: false,
			timings: true,
			chunks: false,
			chunkModules: false,
			modules: false
		}
	})

	// compiler.watch({}, () => {})
	app.use(wdm)
	app.use(webpackHotMiddleware(compiler))
	fileSystem = wdm.fileSystem
} else {
	// Force HTTPs if FORCE_SSL env var is set to 'true'
	if (FORCE_SSL) {
Example #6
0
var fs = require('fs')
var path = require('path')
var express = require('express')
var rewrite = require('express-urlrewrite')
var webpack = require('webpack')
var webpackDevMiddleware = require('webpack-dev-middleware')
var WebpackConfig = require('./webpack.config')

var app = express()

var directory = path.join(__dirname, 'example');

app.use(webpackDevMiddleware(webpack(WebpackConfig), {
  publicPath: '/__build__/',
  stats: {
    colors: true
  }
}))


fs.readdirSync(directory).forEach(function (file) {
  if (fs.statSync(path.join(directory, file)).isDirectory())
    app.use(rewrite('/' + file + '/*', '/' + file + '/index.html'))
})
// app.use(rewrite('/', '/app/index.html'))

app.use(express.static(__dirname))

// app.get('/*', function (request, response){
//   response.sendFile(path.resolve(__dirname, 'app', 'index.html'))
// })
Example #7
0
    app: './app.js'
  },
  output: {
    path: path.resolve('dist'),
    filename: '[name].js'
  },
  module: {
    loaders: [
      {
        test: /\.jsx?$/,
        exclude: /(node_modules|bower_components)/,
        loader: 'babel',
        query: {
          presets: ['es2015']
        }
      }
    ]
  },
  devtool: 'source-map'
})

express()
.use(function (req, res, next) {
  res.set('Access-Control-Allow-Origin', '*')
  next()
})
.use(webpackMiddleware(webpack, {lazy: true}))
.use(express.static('.'))
.use(express.static('./node_modules/alloyeditor/dist'))
.listen(3000)
if (isDev) {

    // static assets served by webpack-dev-middleware & webpack-hot-middleware for development
    var webpack = require('webpack'),
        webpackDevMiddleware = require('webpack-dev-middleware'),
        webpackHotMiddleware = require('webpack-hot-middleware'),
        webpackDevConfig = require('./webpack.config.js');

    var compiler = webpack(webpackDevConfig);

    // attach to the compiler & the server
    app.use(webpackDevMiddleware(compiler, {

        // public path should be the same with webpack config
        publicPath: webpackDevConfig.output.publicPath,
        noInfo: true,
        stats: {
            colors: true
        }
    }));
function ping(type, id) {
  console.log('sending ping to %s', id);
  let res = sessions[type][id];
  if (res.connection.writable) {
    res.write('eventId: 0\n\n');
  } else {
    // remove the res object if it's no longer writable
    delete sessions[type][id];
  }
}
const fs = require('fs')
const express = require('express')
const webpackDevMiddleware = require('webpack-dev-middleware')
const webpack = require('webpack')

const app = express()
let options = {lazy: true}
let config = require('./webpack.config')
let compiler = webpack(config)
let middleware = webpackDevMiddleware(compiler, options)

app.use((req, res, next) => {
    const entry = req.path.substring(1).replace('.js', '')
    const target = `./src${req.path}`
    const exists = Object.keys(config.entry).indexOf(entry) !== -1
    if(!exists && fs.existsSync(target)) {
        config.entry[entry] = target
        compiler = webpack(config)
        middleware = webpackDevMiddleware(compiler, options)
    }
    middleware(req, res, next)
})

app.listen(process.env.PORT || 3000)
Example #10
0
const webpackConfig = webpackConfigBuilder('development')
const bundler = webpack(webpackConfig)

// Run Browsersync and use middleware for Hot Module Replacement
browserSync({
  server: {
    baseDir: 'src',

    middleware: [
      webpackDevMiddleware(bundler, {
        // Dev middleware can't access config, so we provide publicPath
        publicPath: webpackConfig.output.publicPath,

        // pretty colored output
        stats: { colors: true },

        // Set to false to display a list of each file that is being bundled.
        noInfo: true

        // for other settings see
        // http://webpack.github.io/docs/webpack-dev-middleware.html
      }),

      // bundler should be the same as above
      webpackHotMiddleware(bundler)
    ]
  },

  // no need to watch '*.js' here, webpack will take care of it for us,
  // including full page reloads if HMR won't work
  files: [
Example #11
0
'use strict';

const debug = require('debug');
const webpack = require('webpack');
const express = require('express');
const webpackDevMiddleware = require('webpack-dev-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const config = require('./webpack.config.dev');

const app = new express();
const webpacked = webpack(config.webpack);

debug.enable('dev');

app.use(webpackDevMiddleware(webpacked, config.server.options));
app.use(webpackHotMiddleware(webpacked));

app.listen(config.server.port, config.server.host, (error) => {
  if (error) {
    console.error(error);
    return;
  }

  debug('dev')('`webpack-dev-server` listening on port %s', config.server.port);
});
Example #12
0
import webpack from 'webpack';
import webpackMiddleware from 'webpack-dev-middleware';
import webpackHotMiddleware from 'webpack-hot-middleware';
import webpackConfig from '../webpack.config.dev';
import users from './routes/users';
import bodyParser from 'body-parser';

const app = express();

app.use(bodyParser.json());

app.use('/api/users', users);

const compiler = webpack(webpackConfig);

app.use(webpackMiddleware(compiler, {
  hot: true,
  publicPath: webpackConfig.output.publicPath,
  noInfo: true
}));

app.use(webpackHotMiddleware(compiler));

app.get('/*', (req, res) => {
  res.sendFile(path.join(__dirname, './index.html'));
});

app.listen(3000, () => console.log('App listening at http://localhost:3000'));

Example #13
0
const webpackHotMiddleware = require('webpack-hot-middleware');
const webpack = require('webpack');

const webpackConfig = require('./build/webpack.dev.config');

const app = express();
if (process.env.NODE_ENV === 'production') {
    const compression = require('compression');
    app.use(compression());
    app.use(express.static(path.join(__dirname, 'dist'), {
        maxAge: '1d'
    }));
} else {
    const compiler = webpack(webpackConfig);
    app.use(webpackDevMiddleware(compiler, {
        hot: true,
        publicPath: webpackConfig.output.publicPath
    }));
    app.use(webpackHotMiddleware(compiler, {
        log: () => {}
    }));
}

app.use((req, resp, next) => {
    if (req.originalUrl.indexOf('/ews') === 0){
        forwardRequest({
            req,
            resp,
            host: 'ews.500.com',
            ip: '192.168.50.202',
            path: req.originalUrl.replace('/ews', '')
        });
Example #14
0
import express from 'express';
import webpack from 'webpack';
import webpackMiddleware from 'webpack-dev-middleware';
import open from 'opn';
import yargs from 'yargs';

const argv = yargs
  .boolean('open', 'o', false)
  .argv;

const webpackConfig = {
  devtool: 'eval',
  entry: {tests: path.join(__dirname, 'tests.js')},
  output: {path: path.join(__dirname, 'built'), filename: '[name].js'},
  module: {loaders: [{test: /\.js$/, exclude: /node_modules/, loader: 'babel?stage=0&optional[]=runtime'}]},
};

const app = express()
  .get('/', (req, res) => { res.sendFile(path.join(__dirname, './index.html')); })
  .get('/chai.js', (req, res) => { res.sendFile(path.join(__dirname, '../node_modules/chai/chai.js')); })
  .get('/mocha.js', (req, res) => { res.sendFile(path.join(__dirname, '../node_modules/mocha/mocha.js')); })
  .get('/mocha.css', (req, res) => { res.sendFile(path.join(__dirname, '../node_modules/mocha/mocha.css')); })
  .use('/built', webpackMiddleware(webpack(webpackConfig), {stats: {colors: true}}))
  .use(express.static(path.join(__dirname)));

app.listen(8080, err => {
  if (err) throw err;
  console.log('server listening at 0.0.0.0:8080');
  if (argv.open) open('http://0.0.0.0:8080');
});
// // -------------------
// // client webpack
console.log(process.env.USE_WEBPACK);
// if (process.env.USE_WEBPACK === 'true') {
    var webpackMiddleware = require('webpack-dev-middleware'),
        webpackHotMiddleware = require('webpack-hot-middleware'),
        webpack = require('webpack'),
        clientConfig = require('../../webpack.client');
        
    const compiler = webpack(clientConfig);
    app.use(webpackMiddleware(compiler, {
        publicPath: '/build/',
        stats:{
            colors: true,
            chunks: false,
            assets: false,
            timings: false,
            modules: false,
            hash: false,
            version: false
        }
     }));

     app.use(webpackHotMiddleware(compiler));
    
    console.log(chalk.bgRed('Using Webpack dev middleware ! This is for dev only'));
// }

// // -------------------
// configure express 

app.set('view engine', 'jade');
Example #16
0
app.set('x-powered-by', false);
app.locals.messageServer = messageServer;

app.use(logging);
app.use('/api', apiRouter);

if (__DEVELOPMENT__) {
  const webpackDevMiddleware = require('webpack-dev-middleware');
  const webpackHotMiddleware = require('webpack-hot-middleware');
  const webpack = require('webpack');
  const webpackConfig = require('../../webpack.config.js');
  let compiler = webpack(webpackConfig);
  app.use(webpackHotMiddleware(compiler));
  app.use(compression());
  app.use(webpackDevMiddleware(compiler, {
    noInfo: true,
    publicPath: '/assets'
  }));
} else {
  app.use(compression());
  app.use('/assets', serveStatic('./dist'));
}

app.get('/favicon.ico', (req, res) => {
  res.sendStatus(404);
});

app.use('/doc', serveStatic('./doc-dist'));

app.use((req, res) => {
  res.send(`
    <!DOCTYPE html>
import path from 'path'
import express from 'express'
import webpack from 'webpack'
import webpackDevMiddleware from 'webpack-dev-middleware'
import webpackConfig from './webpack.config.dev'

const app = express();

app.use(webpackDevMiddleware(webpack(webpackConfig), {
  publicPath: webpackConfig.output.publicPath,
  stats: { colors: true }
}));

app.use('/public', express.static(__dirname + '/public'))


app.get('/', function(req, res) {
  res.sendFile(path.join(__dirname, 'index.html'));
});


app.get('/api', function(req, res) { 
 	res.setHeader('Content-Type', 'application/json');
  res.sendFile(path.join(__dirname, '/data.json'));
});


app.listen(3001, 'localhost', function (err) {
  if (err) {
    console.log(err);
    return;
Example #18
0
  start: function(prodMode) {

    var env = {
      production: process.env.NODE_ENV === 'production'
    };

    var express = require('express');
    var app = express();
    app.use(compression())
    app.use("/images", express.static('images'))
    app.set('view engine', 'ejs');
    app.set('views', __dirname + '/server/views');
    app.use(bodyParser.urlencoded({ extended: false }))
    app.use(bodyParser.json())
    app.use(methodOverride())

    var port = Number(process.env.PORT || 3000);

    if (!env.production) {
      var webpack = require("webpack");
      var webpackMiddleware = require("webpack-dev-middleware");
      var webpackHotMiddleware = require('webpack-hot-middleware');
      var config = require("./webpack.dev.config.js");
      var compiler = webpack(config);

      app.use(webpackMiddleware(compiler, {
        publicPath: config.output.publicPath,
        contentBase: 'src',
        stats: {
          colors: true,
          hash: false,
          timings: true,
          chunks: false,
          chunkModules: false,
          modules: false
        }
      }));

      app.use(webpackHotMiddleware(compiler));


    } else {
      app.use("/static", express.static(__dirname + '/dist'));
    }


    var host = process.env.ES_URL || "http://localhost:9200"

    app.use("/api", cors({
      origin:"*",
      maxAge:20*24*60*60 //20 days like elastic
    }))
    app.use("/api/movies", SearchkitExpress.createRouter({
      host, index:"movies"
    }))

    app.use("/api/crimes", SearchkitExpress.createRouter({
      host, index:"crimes"
    }))

    app.use("/api/taxonomy", SearchkitExpress.createRouter({
      host, index:"taxonomynested"
    }))


    app.get('*', function(req, res) {
      res.render('index');
    });

    app.listen(port, function () {
      console.log('server running at localhost:3000, go refresh and see magic');
    });
  }
Example #19
0
const webpack = require('webpack');
const webpackMiddleware = require('webpack-dev-middleware');
const proxy = require('http-proxy-middleware');
const webpackHotMiddleware = require('webpack-hot-middleware');
const config = require('./webpack.dev.config.js');

const port = 3001;
const app = express();

const compiler = webpack(config);
const middleware = webpackMiddleware(compiler, {
    publicPath: config.output.publicPath,
    stats: {
      colors: true,
      hash: false,
      timings: true,
      chunks: false,
      chunkModules: false,
      modules: false
    }
});
app.use(middleware);
app.use(webpackHotMiddleware(compiler));

app.use('*', proxy({target: 'http://localhost:3000'}));

app.listen(port, '0.0.0.0', function onStart(err) {
  if (err) {
    console.log(err);
  }
  console.info('==> 🌎 Listening on port %s. Open up http://0.0.0.0:%s/ in your browser.', port, port);
Example #20
0
'use strict'

const config = require('config')
const https = require('https')
const socketIO = require('socket.io')
const path = require('path')
const express = require('express')
const webpack = require('webpack')
const webpackMiddleware = require('webpack-dev-middleware')

const ssl = require('./ssl/index')
const webpackConfig = require('./webpack.config.js')
const U = require('./src/lib/Utils')
const socketServer = require('./src/lib/SocketServer')

const app = express()
if (config.useWebpackDevMiddleware) {
  app.use(webpackMiddleware(webpack(webpackConfig)))
}
app.use(webpackMiddleware(webpack(webpackConfig)))
app.use('/', express.static(path.resolve(__dirname, 'public')))

ssl.subscribe((options) => {
  const server = https.createServer(options, app)
  const ws = socketIO(server)
  U.fromEvent(ws, 'connection')
    .map((x) => ({event: 'connection', params: [x]}))
    .subscribe(socketServer.connect)
  server.listen(config.port, () => console.log('STARTED:', config.port, process.env.NODE_ENV))
})
Example #21
0
  server: {
    baseDir: 'src',

    middleware: [
      historyApiFallback(),

      webpackDevMiddleware(bundler, {
        // Dev middleware can't access config, so we provide publicPath
        publicPath: config.output.publicPath,

        // These settings suppress noisy webpack output so only errors are displayed to the console.
        noInfo: false,
        quiet: false,
        stats: {
          assets: false,
          colors: true,
          version: false,
          hash: false,
          timings: false,
          chunks: false,
          chunkModules: false
        },

        // for other settings see
        // http://webpack.github.io/docs/webpack-dev-middleware.html
      }),

      // bundler should be the same as above
      webpackHotMiddleware(bundler)
    ]
  },
Example #22
0
server.use(compression());

// Stub for assets, in case running in dev mode.
let assets;

// Webpack (for development)
if (isDeveloping) {
  server.use(morgan('dev'));
  const compiler = webpack(config);
  const middleware = webpackMiddleware(compiler, {
    publicPath : config.output.publicPath,
    contentBase: 'src',
    stats      : {
      colors      : true,
      hash        : false,
      timings     : true,
      assets      : false,
      children    : false,
      chunks      : true,
      chunkModules: false,
      modules     : false
    }
  });
  server.use(middleware);

  server.use(webpackHotMiddleware(compiler, {
    log: console.log
  }));
} else {
  const buildPath = require('../../webpack.config.prod').output.path;
  assets = require('../../assets.json');
  server.use(morgan('combined'));
  });

  app.use('/static', express.static('build'));
  app.get('*', renderPage);
} else {
  // Hot Module Reloading
  const webpack = require('webpack');
  const devWebpackConfig = require('../../webpack/webpack.config.development.js');
  const webpackDevMiddleware = require('webpack-dev-middleware');
  const webpackHotMiddleware = require('webpack-hot-middleware');

  const compiler = webpack(devWebpackConfig);

  app.use(webpackDevMiddleware(compiler, {
    noInfo: true,
    hot: true,
    publicPath: devWebpackConfig.output.publicPath,
  }));

  app.use(webpackHotMiddleware(compiler, {
    log: console.log,
    reload: true,
  }));

  app.get('*', renderDevPage);
}

// catch 404 and forward to error handler
app.use(function(req, res, next) {
  var err = new Error('Not Found');
  err.status = 404;
#! node_modules/.bin/babel-node

import path from 'path'
import webpack from 'webpack'
import config from './webpack.config'
import browserSync from 'browser-sync'
import devMiddleware from 'webpack-dev-middleware'
import hotMiddleware from 'webpack-hot-middleware'

const bundler = webpack(config)
const server = browserSync.create('dev')
const baseDir = 'src'

const devMiddlewareInstance = devMiddleware(bundler, {
  publicPath: config.output.publicPath,
  noInfo: true,
})

devMiddlewareInstance.waitUntilValid(() =>
  server.init({
    open: false,
    files: [path.join(baseDir, 'index.html')],
    server: {
      baseDir,
      middleware: [
        devMiddlewareInstance,
        hotMiddleware(bundler),
      ],
    },
  })
)
Example #25
0
				test: /\.coffee$/, loader: "coffee-loader"
			},
			{
				test: /\.(coffee\.md|litcoffee)$/, loader: "coffee-loader?literate"
			}
		]
	},
	resolve: {
		root: [
			path.resolve('../node_modules'),
		]
	}
});

app.use(webpackDevMiddleware(compiler, {
	publicPath: '/js'
}));

// init database
var pdb = new PouchDB("db"); // database init
var pdb_users = new PouchDB("_users"); // database init
var auth = require("./app_modules/auth.js")(pdb_users);

// load environment file and store it
// in "process.env.*" for usage
dotenv.load({
	path: __dirname + "/.env"
});

// express use stuff
// app.use(express.logger('tiny'));
var path = require('path');

var app = express();

var port = 8000;

var publicDir = path.join(__dirname, 'public');

app.use(morgan('combined'))

var webpackCompiler = webpack(webpackConfig);

app.use(webpackDevMiddleware(webpackCompiler, {
  noInfo: true,
  stats: {
    colors: true
  }
}));

app.use(webpackHotMiddleware(webpackCompiler, {
  reload: true
}))

app.use(express.static(publicDir));

app.get('/api/foo', function(req, res){
  res.send({
    entries: [
      {
        name: 'Entry A',
        description: 'This is a very nice entry'
Example #27
0
    //generate static files to './dist'
    webpackConfig.plugins.push(new webpack.optimize.UglifyJsPlugin({
        compress:{warnings:false}
    }));
    webpack(webpackConfig).run((err,stats)=>{
        console.log('[webpack compiled]',err?err:stats);
    });
}else{
    //start webpack dev server
    webpackConfig.entry.app.unshift('webpack-hot-middleware/client?reload=true');
    webpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin());
    const compiler = webpack(webpackConfig);

    app.use(webpackDevMiddleware(compiler, {
        noInfo:true,
        contentBase: './dist',
        publicPath: '/assets/'
    }));

    app.use(webpackHotMiddleware(compiler));
    app.use(cookieParser());
    //logger
    app.use((req, res, next)=> {
        console.log('Time:', Date.now());
        console.log('request', req.url);
        console.log(req.cookies);
        next();
    });
    app.use('/api',router);
    app.get('/favicon.ico',(req,res)=>{
        res.sendFile(__dirname+'/dist/favicon.ico');
Example #28
0
require('babel-register');
var express = require('express');
var path = require('path');
var webpack = require('webpack');
var webpackDevMiddleware = require('webpack-dev-middleware');
var webpackHotMiddleware = require('webpack-hot-middleware');
var webpackConfig = require('./webpack.config');

const app = express();
const compiler = webpack(webpackConfig);
app.use(webpackDevMiddleware(compiler));
app.use(webpackHotMiddleware(compiler));
app.use(express.static('app'));

app.get('/', (req, res) => {
  res.sendFile(path.join(__dirname, 'build/index.html'));
});

app.listen(3000, (err) => {
    if(err) return console.error(err)
    console.log("Application Server running on port 3000");
});
    });
    response.on('end', function() {
      onResponse(body);
    });
  });
}

const app = express();

// Webpack middleware
const webpackConfig = require("../webpack.config");
const compiler = webpack(webpackConfig);

app.use(webpackDevMiddleware(compiler, {
  publicPath: webpackConfig.output.publicPath,
  noInfo: true,
  stats: { colors: true }
}));

if(feature.isEnabled("hotReloading")) {
  app.use(webpackHotMiddleware(compiler));
}

// Static middleware

app.use(express.static("public/js/test/examples"));
app.use(express.static("public"));

// Routes
app.get("/", function(req, res) {
  res.sendFile(path.join(__dirname, "../index.html"));
Example #30
0
    // no saved data yet, just continue
}

function saveDB(callback) {
    fs.writeFile('db.json', JSON.stringify(todoLists, null, 4), 'utf8', callback);
}

if (process.env.NODE_ENV !== 'production') {
    var webpackDevMiddleware = require('webpack-dev-middleware'),
        webpack = require('webpack'),
        webpackConfig = _cloneDeep(require('./webpack.config'));

    webpackConfig.debug = true;
    webpackConfig.devtool = 'inline-source-map';

    app.use(webpackDevMiddleware(webpack(webpackConfig), { stats: false }));
}

app.use(bodyParser.json());

// PAGES

app.get('/', renderApp);
app.get('/lists*', renderApp);

function renderApp(req, res) {
    var stores = {
        'TodoStore': new TodoStore({ lists: todoLists })
    };

    var flux = new Fluxxor.Flux(stores, require('./app/actions'));