sending html using api plugin
Hi, is it possible to send content with the mimetype
text/html
using the api plugin?
I would like to expose a small landing page for an external oauth flow.Solution:Jump to solution
``ts
response
// @ts-expect-error This should be Mimetypes enum but it currently doesn't have
text/html`
.setContentType('text/html')
.status(HttpCodes.OK)...6 Replies
Solution
And make a PR adding
text/html
to https://github.com/sapphiredev/plugins/blob/main/packages/api/src/lib/utils/MimeTypes.ts
and optionally also a method html
to https://github.com/sapphiredev/plugins/blob/main/packages/api/src/lib/structures/api/ApiResponse.ts so you can instead write
alright, thanks! I'll do that :)
BTW @vanitasboi
😊 posted the PR
awesome
Released v.5.1.0 @vanitasboi
that's awesome, thanks a bunch