Module iqps_backend::routing::handlers
source · Expand description
All endpoint handlers and their response types.
All endpoints accept JSON or URL query parameters as the request. The response of each handler is a BackendResponse
serialized as JSON and the return type of the handler function determines the schema of the data sent in the response (if successful)
The request format is described
Structs§
- The request format for the delete endpoint
- The request format for the paper edit endpoint
- The details for an uploaded question paper file
- The request format for the OAuth endpoint
- The response format for the OAuth endpoint
- The response format for the user profile endpoint
- The status of an uploaded question paper file
Constants§
- 10 MiB file size limit
Functions§
- Deletes a given paper. Library papers cannot be deleted.
- Paper edit endpoint (for admin dashboard) Takes a JSON request body. The
id
field is required. Other optional fields can be set to change that particular value in the paper. - Fetches all the unapproved papers.
- Healthcheck route. Returns a
Hello World.
message if healthy. - Takes a Github OAuth code and returns a JWT auth token to log in a user if authorized
- Returns a user’s profile (the JWT and username) if authorized and the token is valid. Can be used to check if the user is logged in.
- Searches for question papers given a query and an optional
exam
parameter. - Fetches all question papers that match one or more properties specified.
course_name
is compulsory. - Uploads question papers to the server
Type Aliases§
- The return type of a handler function. T is the data type returned if the operation was a success