Go binary/server for helping run/build sessions for the Maze Rats TTRPG
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

20 lines
446 B

package handlers
import (
"mazeratsgen/internal/tables"
"net/http"
"strings"
"time"
)
// @Summary Generate a character name
// @Tags character
// @Produce application/json, text/plain
// @Method GET
// @Router /api/generate/name [get]
// @Success 200
func GenName(w http.ResponseWriter, r *http.Request) {
n := tables.GenRandomName(time.Now().UnixNano())
template := strings.TrimSpace("{{.FullName}}")
WriteResponse(w, r, n, template)
}