0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-03 19:12:41 +00:00

Added robots.txt, nofollow in metatags

Also noindex on /print/ pages
This commit is contained in:
Trevor Buckner
2020-04-20 13:46:18 -04:00
parent bdf37d8fe7
commit e88253f364
6 changed files with 19 additions and 7 deletions

View File

@@ -44,9 +44,14 @@ const HomebrewModel = require('./server/homebrew.model.js').model;
const welcomeText = require('fs').readFileSync('./client/homebrew/pages/homePage/welcome_msg.md', 'utf8');
const changelogText = require('fs').readFileSync('./changelog.md', 'utf8');
String.prototype.replaceAll = function(s, r){return this.split(s).join(r);};
//Robots.txt
app.get('/robots.txt', (req, res)=>{
return res.sendFile(`${__dirname}/robots.txt`);
});
//Source page
String.prototype.replaceAll = function(s, r){return this.split(s).join(r);};
app.get('/source/:id', (req, res)=>{
HomebrewModel.get({ shareId: req.params.id })
.then((brew)=>{
@@ -59,7 +64,7 @@ app.get('/source/:id', (req, res)=>{
});
});
//User Page
app.get('/user/:username', (req, res, next)=>{
const fullAccess = req.account && (req.account.username == req.params.username);
HomebrewModel.getByUser(req.params.username, fullAccess)
@@ -72,7 +77,7 @@ app.get('/user/:username', (req, res, next)=>{
});
});
//Edit Page
app.get('/edit/:id', (req, res, next)=>{
HomebrewModel.get({ editId: req.params.id })
.then((brew)=>{
@@ -115,7 +120,7 @@ app.get('/print/:id', (req, res, next)=>{
});
//Render Page
//Render the page
const render = require('vitreum/steps/render');
const templateFn = require('./client/template.js');
app.use((req, res)=>{