Disallow scratch papers to be crawled by robots

This commit is contained in:
Jason Park
2019-01-24 03:15:16 -05:00
parent 0ffee2e5dc
commit 83213cdb18
2 changed files with 6 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
const path = require('path');
const express = require('express');
const app = express();
@@ -18,6 +19,9 @@ app.use((req, res, next) => {
next();
}
});
app.get('/robots.txt', (req, res) => {
res.sendFile(path.resolve(__dirname, '..', 'robots.txt'));
});
app.use(apiEndpoint, backend);
app.use(frontend);

2
robots.txt Normal file
View File

@@ -0,0 +1,2 @@
User-agent: *
Disallow: /scratch-paper/