#sending html using api plugin
1 messages · Page 1 of 1 (latest)
response
// @ts-expect-error This should be Mimetypes enum but it currently doesn't have `text/html`
.setContentType('text/html')
.status(HttpCodes.OK)
.end('<html code here>'
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
response.html(HttpCodes.OK, '<html code here>')
alright, thanks! I'll do that :)
Thank you for marking this question as solved!
Question Message ID
1118132837376327691
Solution Message ID
1118139978342473749
Learn more
BTW @dark crescent
😊 posted the PR
awesome
Released v.5.1.0 @dark crescent