Even more docs, adds response utils to module
This commit is contained in:
@@ -1,4 +1,35 @@
|
||||
export const NotFound = (msg?: string) =>
|
||||
/**
|
||||
* @module
|
||||
* BearMetal Router response utilities
|
||||
*/
|
||||
|
||||
/**
|
||||
* @description a response with a status of 404
|
||||
*/
|
||||
export const NotFound = (msg?: string): Response =>
|
||||
new Response(msg ?? "Not Found", { status: 404 });
|
||||
export const InternalError = (msg?: string) =>
|
||||
/**
|
||||
* @description a response with a status of 500
|
||||
*/
|
||||
export const InternalError = (msg?: string): Response =>
|
||||
new Response(msg ?? "Internal Server Error", { status: 500 });
|
||||
/**
|
||||
* @description a response with a status of 400
|
||||
*/
|
||||
export const BadRequest = (msg?: string): Response =>
|
||||
new Response(msg ?? "Bad Request", { status: 400 });
|
||||
/**
|
||||
* @description a response with a status of 401
|
||||
*/
|
||||
export const Unauthorized = (msg?: string): Response =>
|
||||
new Response(msg ?? "Unauthorized", { status: 401 });
|
||||
/**
|
||||
* @description a response with a status of 403
|
||||
*/
|
||||
export const Forbidden = (msg?: string): Response =>
|
||||
new Response(msg ?? "Forbidden", { status: 403 });
|
||||
/**
|
||||
* @description a response with a status of 200
|
||||
*/
|
||||
export const Ok = (msg?: string): Response =>
|
||||
new Response(msg ?? "OK", { status: 200 });
|
||||
|
Reference in New Issue
Block a user