Add basic robots.txt
So we get indexed.
This commit is contained in:
parent
98372d924d
commit
8f44e57c72
2 changed files with 7 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package publicreport
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/htmlpage"
|
||||
|
|
@ -25,6 +26,11 @@ func getRoot(w http.ResponseWriter, r *http.Request) {
|
|||
)
|
||||
}
|
||||
|
||||
func getRobots(w http.ResponseWriter, r *http.Request) {
|
||||
fmt.Fprint(w, "User-agent: *\n")
|
||||
fmt.Fprint(w, "Allow: /\n")
|
||||
}
|
||||
|
||||
// Respond with an error that is visible to the user
|
||||
func respondError(w http.ResponseWriter, m string, e error, s int) {
|
||||
log.Warn().Int("status", s).Err(e).Str("user message", m).Msg("Responding with an error")
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import (
|
|||
func Router() chi.Router {
|
||||
r := chi.NewRouter()
|
||||
r.Get("/", getRoot)
|
||||
r.Get("/robots.txt", getRobots)
|
||||
r.Get("/email/report/{report_id}/subscription-confirmation", getEmailReportSubscriptionConfirmation)
|
||||
r.Get("/nuisance", getNuisance)
|
||||
r.Post("/nuisance-submit", postNuisance)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue