Skip to content

Commit

Permalink
Setup Your Server with Node, Express, and Babel
Browse files Browse the repository at this point in the history
  • Loading branch information
seejamescode committed Mar 7, 2017
1 parent 0dbaf64 commit aafd7e3
Show file tree
Hide file tree
Showing 3 changed files with 5,628 additions and 2 deletions.
16 changes: 16 additions & 0 deletions index.js
@@ -0,0 +1,16 @@
import compression from 'compression';
import express from 'express';

const app = express();
const port = process.env.PORT || 8080;
app.use(compression());

app.use(express.static('./build'));

app.listen(port, (err) => {
if (err) {
console.log(err);
return;
}
console.log(`Server is live at http://localhost:${port}`);
});
19 changes: 17 additions & 2 deletions package.json
Expand Up @@ -3,16 +3,31 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"babel-cli": "^6.23.0",
"babel-preset-es2015": "^6.22.0",
"babel-preset-stage-2": "^6.22.0",
"compression": "^1.6.2",
"express": "^4.15.2",
"react": "^15.4.2",
"react-dom": "^15.4.2"
},
"devDependencies": {
"babel-watch": "^2.0.6",
"concurrently": "^3.4.0",
"react-scripts": "0.9.4"
},
"proxy": "http://localhost:8081",
"scripts": {
"start": "react-scripts start",
"bluemix": "babel-node index.js",
"start": "concurrently \"PORT=8080 react-scripts start\" \"PORT=8081 babel-watch index.js\"",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"babel": {
"presets": [
"es2015",
"stage-2"
]
}
}
}

0 comments on commit aafd7e3

Please sign in to comment.