Skip to content

Custom "Not Found" callback. #440

@AdriaanBoshoff

Description

@AdriaanBoshoff

Is it possible to add a custom callback for when a endpoint does not exist? Currently it only returns "Not Found" and I wish to add more logic to this.

EDIT:

THorse.All('*',
    procedure(Req: THorseRequest; Res: THorseResponse; Next: TProc)
    begin
      Res.Send('Custom Not Found');
    end);

This only works if a path is provided such as: http://localhost:8080/test/ but when it's just http://localhost:8080/ then it no longer works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions