'use strict';

// make `.jsx` file requirable by node
require('node-jsx').install();

import express from 'express';
import path from 'path';
import ReactEngine from 'react-engine';
import env from 'node-env-file';

const app = express();
const http = require('http').Server(app);

env('./.env');

const port = process.env.PORT || 9000;

// create the view engine with `react-engine`
let engine = ReactEngine.server.create({
  routes: require(path.join(__dirname, '/public/routes.jsx')),
  routesFilePath: path.join(__dirname, '/public/routes.jsx')
});

// set the engine
app.engine('.jsx', engine);

// set the view directory
app.set('views', path.join(__dirname, '/public/views'));

// set jsx as the view engine
app.set('view engine', 'jsx');

// finally, set the custom view
app.set('view', require('react-engine/lib/expressView'));

//expose public folder as static assets
app.use(express.static( path.join(__dirname, '/public' )));

require('./app/router.js')(app);

http.listen(port, function() {
  console.log('listing on port:' + port);
});

@@ -6,16 +6,39 @@
 strict';
+ // eslint-disable-line
 %0A%0A// mak
@@ -70,16 +70,105 @@
 by node%0A
+// TODO: Node-JSX is depreated need to move this to Babel when React Engine supports it.%0A
 require(
@@ -187,16 +187,33 @@
 install(
+%7B harmony: true %7D
 );%0A%0Aimpo
@@ -1167,13 +1167,36 @@
 + port);
+ // eslint-disable-line
 %0A%7D);%0A

clean up and adding a TODO