Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Commit

Permalink
undoing unnecessary changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris DeCairos committed Nov 16, 2018
1 parent 039abf9 commit 0673d29
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 19 deletions.
41 changes: 41 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"rules": {
"indent": [1, 2],
"no-extra-boolean-cast": [1],
"no-empty": [1],
"no-lonely-if": [2],
"no-inner-declarations": [2, "both"],
"space-after-keywords": [2],
"space-before-keywords": [2, "always"],
"space-before-blocks": [2],
"space-before-function-paren": [2, "never"],
"no-console": [0],
"comma-dangle": [1],
"eol-last": [2],
"no-unused-vars": [1, {"vars": "all", "args": "none"}],
"linebreak-style": [2, "unix"],
"semi": [1, "always"],
"eqeqeq": [2],
"no-else-return": [2],
"dot-notation": [2],
"no-eq-null": [2],
"no-return-assign": [2],
"radix": [2],
"handle-callback-err": [2]
},
"env": {
"es6": true,
"browser": true,
"commonjs": true,
"node": true
},
"extends": "eslint:recommended",
"ecmaFeatures": {
"jsx": true,
"experimentalObjectRestSpread": true,
"modules": true
},
"plugins": [
"react"
]
}
30 changes: 15 additions & 15 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
let Habitat = require('habitat');
var Habitat = require('habitat');

Habitat.load();

let express = require('express'),
url = require('url'),
compression = require('compression'),
helmet = require('helmet'),
frameguard = helmet.frameguard,
reactRouted = require('./dist/lib/react-server-route.js'),
locationParser = require('./dist/lib/location-parser.js'),
bodyParser = require('body-parser'),
env = new Habitat(),
routes = require('./routes'),
app = express();
var express = require('express'),
url = require('url'),
compression = require('compression'),
helmet = require('helmet'),
frameguard = helmet.frameguard,
reactRouted = require('./dist/lib/react-server-route.js'),
locationParser = require('./dist/lib/location-parser.js'),
bodyParser = require('body-parser'),
env = new Habitat(),
routes = require('./routes'),
app = express();

const CSP_DIRECTIVES = require('./scripts/csp-directives.js');

Expand All @@ -34,8 +34,8 @@ app.use(helmet.hsts({


// Redirect to SSL if set
app.use(function(req, resp, next) {
if (!req.secure && env.get('FORCE_SSL')) {
app.use(function(req, resp, next){
if (!req.secure && env.get('FORCE_SSL')){
if (req.method === "GET") {
resp.redirect(301, `https://${req.headers.host}${req.originalUrl}`);
}
Expand Down Expand Up @@ -98,6 +98,6 @@ function errorHandler(err, req, res, next) {

app.use(errorHandler);

app.listen(env.get('PORT'), function() {
app.listen(env.get('PORT'), function () {
console.log('Server listening ( http://localhost:%d )', env.get('PORT'));
});
5 changes: 1 addition & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ module.exports = {
loaders: [`file-loader`] },
{
test: /\.(otf|eot|svg|ttf|woff|woff2)(\?.+)?$/,
loader: `url-loader`,
options: {
limit: 8192
}
loader: `url-loader?limit=8192`
},
{
test: /\.less$/,
Expand Down

0 comments on commit 0673d29

Please sign in to comment.