Add basic robots.txt

So we get indexed.
This commit is contained in:
Eli Ribble 2026-01-19 21:33:26 +00:00
parent 98372d924d
commit 8f44e57c72
No known key found for this signature in database
2 changed files with 7 additions and 0 deletions

View file

@ -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")

View file

@ -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)