Skip to content
Discussion options

You must be logged in to vote

ResuiltHandler can respond anything, @JoshElias , including strings with a corresponding MIME type.

https://ez.robintail.cz/v24.7.1/non-json-response

Your implementation of ResultHandler is looking good, but it should make a string out of object-based output

const robotsResultHandler = new ResultHandler({
  positive: { statusCode: 200, mimeType: 'text/plain', schema: z.string() },
  negative: { statusCode: 404, mimeType: null, schema: z.never() },
  handler: ({ output, response }) => {
    response.set('Cache-Control', 'max-age=2592000');
    response.status(200);
    response.send(output.toString()); // somehow
  },
});

Looks like the base type is IOSchema

This type is for I/O: input and

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by RobinTail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #2855 on July 29, 2025 20:10.