palace library

Classes

BodyParser
will parse the incoming request so if json req.body type will be Map and so on
COLORS
CorsGuard
EndPoint
every request must have a endpoint ready to handle it else the palace will respond with 404 each endpoint has its own method
LogsGuard
Palace
Request
  • contains simplified logic to extract data from the io req class
  • Response
  • contains getters and logic to respond to incoming req
  • Properties

    allowLogs Future<bool?>
    no setter
    isInProduction Future<bool?>
    no setter

    Functions

    getFileContentType(File file) ContentType?
    getFileMimeType(File file) String?
    getFileName(File file) String
    validateDto(Object dto) List<String>
    takes dto and return list of faliure errors message
    yaml<T>(String key) Future<T?>
    load and extract yaml file attribute by the parent key

    Typedefs

    Guard = FutureOr<void> Function(Request req, Response res, Function next)
    Handler = FutureOr<void> Function(Request req, Response res)

    Exceptions / Errors

    BadRequest