Module handlers

Source
Expand description

Contains HTTP Handlers that directly receive and respond to requests to the server.

Structs§

DeleteQrCodeRequest
EditQrCodeRequest
FormCreationRequest
FormGetRequest
FormGetResponse
GetQrCodeRequest
GetQrCodeResponse
ListQrCodesResponse
NewQrCodeRequest
RegistrationRequest

Enums§

ApplicationError
Error derived while handling an HTTP request

Functions§

delete_qr_code
get(/qr_code/delete?id={ID}) edits a QR code with the relevant information
edit_qr_code
get(/qr_code/edit?id={ID}&generation_data={DATA}&slug={SLUG}) edits a QR code with the relevant information
get_form
get(form) runs an SQL query on a provided form id and returns a JSON object of the fields
get_qr_code_data
get(qr_code?slug={SLUG}) runs a sample SQL query and checks if the user is logged in
health_check
Get(/health_check) returns a 200 to indicate the application is running
json_response
Creates an HTTP response with a JSON body constructed from any serializable input
list_forms
get(form/list) runs an SQL query to retrieve all the forms belonging to the user who sent the request
list_qr_codes
get(/qr_codes) lists QR codes assosciated with a given user
login
Get(/login) attempts to log a user in, and if successful returns a JWT token
logout
Get(/logout) logs a user out if they are currently logged in
register
store_form
post(form/store) runs an SQL query to store a new form and all its associated fields
store_qr_code
get(/qr_code/store?generation_data={DATA}&slug={SLUG}) stores a QR code with the relevant information
who_am_i

Type Aliases§

ApplicationResponse
Alias used for all HTTP responses. Uses custom ApplicationError error handler.