inital commit

This commit is contained in:
Lee
2023-11-14 17:56:44 +00:00
commit 161486bf49
38 changed files with 5094 additions and 0 deletions

View File

@ -0,0 +1,10 @@
import { baseMessage } from "./baseMessage";
/**
* Creates a response for a bad request
*
* @returns the bad request message
*/
export function badRequest(message: string) {
return baseMessage(true, message);
}

View File

@ -0,0 +1,13 @@
/**
* Creates a base message for use in JSON responses
*
* @param error the error status
* @param message the message to show
* @returns the base message
*/
export function baseMessage(error: boolean, message: string) {
return {
error: error,
message: message,
};
}

View File

@ -0,0 +1,10 @@
import { baseMessage } from "./baseMessage";
/**
* Creates a response for an unknown route
*
* @returns the unknown route message
*/
export function unknownRoute() {
return baseMessage(true, "Unknown route");
}