handlers

package
v0.0.0-...-bc5d933 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BearerMiddleware

func BearerMiddleware(h httprouter.Handle, secret string) httprouter.Handle

func CorsMiddleware

func CorsMiddleware(next httprouter.Handle) httprouter.Handle

CorsMiddleware defines a middleware for setting common CORS headers. This is useful when running backend and frontend on different ports. TODO: possibly make `Access-Control-Allow-Origin` more restrictive by returning a configurable list of hosts instead of *.

func CorsOptionsHandler

func CorsOptionsHandler(w http.ResponseWriter, r *http.Request)

CorsOptionsHandler defines a global handler for HTTP OPTIONS requests.

func TokenMiddleware

func TokenMiddleware(h httprouter.Handle, secret string) httprouter.Handle

Types

type UserID

type UserID string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL