module
	kind jsfile
	var path = require('path')
	+
	var express = require('express')
	+
	var webpack = require("webpack");
	var webpackDevMiddleware = require("webpack-dev-middleware")
	var webpackHotMiddleware = require("webpack-hot-middleware")
	var webpackConfig = require(process.env.WEBPACK_CONFIG ? process.env.WEBPACK_CONFIG : './webpack.config')
	var app = express()
	var isProduction = process.env.NODE_ENV === 'production'
	var port = isProduction ? process.env.PORT : 3010
	
	var publicPath = path.resolve(__dirname, 'public')
	var hotPath = path.resolve(__dirname, 'build')
	# We point to our static assets
	_ app.use
		_ express.static(publicPath)
	
	var compiler
		_ webpack
			@ webpackConfig
	# We point to our dynamic assets
	_ app.use
		_ webpackDevMiddleware
			@ compiler
			{
				@ log console.log
				@ publicPath webpackConfig.output.publicPath
	_ app.use
		_ webpackHotMiddleware
			@ compiler
			{
				@ log console.log
				@ path '/__webpack_hmr'
				@ heartbeat 10 * 1000
	# And run the server
	_ app.listen
		@ port
		function
			log 'Server running on port ' + port
