feat: update robots.txt to also be auto-generated

This commit is contained in:
Travis Fischer
2021-02-05 23:58:18 -05:00
parent 8172584ed7
commit 70d674d1d8
2 changed files with 14 additions and 2 deletions

14
pages/robots.txt.tsx Normal file
View File

@@ -0,0 +1,14 @@
import React from 'react'
import { host } from 'lib/config'
export default class Robots extends React.Component {
static async getInitialProps({ res }) {
res.setHeader('Content-Type', 'text/plain')
res.write(`User-agent: *
Allow: /
Sitemap: ${host}/sitemap.xml
`)
res.end()
}
}

View File

@@ -1,2 +0,0 @@
User-agent: *
Allow: /