mirror of
https://github.com/fmhy/edit.git
synced 2026-02-14 23:31:12 +11:00
fix(api): return as text/plain
This commit is contained in:
parent
2d746a86de
commit
e60e05270c
5 changed files with 21 additions and 15 deletions
|
|
@ -21,8 +21,8 @@ interface File {
|
|||
}
|
||||
}
|
||||
|
||||
export default defineEventHandler(async () => {
|
||||
let body = ''
|
||||
export default defineEventHandler(async (event) => {
|
||||
let body = '<!-- This is autogenerated content, do not edit manually. -->\n'
|
||||
const f = fetcher({
|
||||
headers: {
|
||||
'User-Agent': 'taskylizard'
|
||||
|
|
@ -44,7 +44,7 @@ export default defineEventHandler(async () => {
|
|||
return isMarkdownFile && !isExcludedFile && !isInExcludedDirectory
|
||||
})
|
||||
|
||||
// console.info(markdownFiles.map((f) => f.name))
|
||||
console.info(markdownFiles.map((f) => f.name))
|
||||
|
||||
// Fetch and concatenate the contents of the markdown files
|
||||
const contents = await Promise.all(
|
||||
|
|
@ -62,5 +62,7 @@ export default defineEventHandler(async () => {
|
|||
}
|
||||
}
|
||||
|
||||
// biome-ignore lint/correctness/noUndeclaredVariables: <explanation>
|
||||
appendResponseHeader(event, 'content-type', 'text/plain')
|
||||
return body
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue