Skip to content

Commit

Permalink
Added plugin for serving robots.txt and added a robots.txt file
Browse files Browse the repository at this point in the history
  • Loading branch information
rmeissn committed Dec 3, 2018
1 parent 8f8d13f commit 636ccf9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
"es6-promise": "^4.1.0",
"es6-shim": "^0.35.3",
"express": "^4.15.0",
"express-robots-txt": "^0.4.0",
"express-state": "^1.4.0",
"extract-text-webpack-plugin": "^2.0.0",
"fabric": "2.2.3",
Expand Down
2 changes: 2 additions & 0 deletions robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow: /
2 changes: 2 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import Cookie from 'js-cookie';
import locale from 'locale';
import handleServerRendering from './server/handleServerRendering'; //moved here the rendering part
import setLocale from './server/setLocale'; //sets the locale from browser or cookies
import robots from 'express-robots-txt' ;


const env = process.env.NODE_ENV;
Expand All @@ -42,6 +43,7 @@ if(env === 'production'){
}

const server = express();
server.use(robots(__dirname + '/robots.txt'));
server.use(cookieParser());
server.use(bodyParser.json({limit: '50mb'}));
server.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
Expand Down

0 comments on commit 636ccf9

Please sign in to comment.