/** * Copyright (c) 2025 taskylizard. Apache License 2.0. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const files = ( [ 'privacy.md', 'ai.md', 'mobile.md', 'audio.md', 'beginners-guide.md', 'developer-tools.md', 'downloading.md', 'educational.md', 'file-tools.md', 'gaming-tools.md', 'gaming.md', 'image-tools.md', 'internet-tools.md', 'linux-macos.md', 'misc.md', 'non-english.md', 'reading.md', 'social-media-tools.md', 'storage.md', 'system-tools.md', 'text-tools.md', 'torrenting.md', 'unsafe.md', 'video-tools.md', 'video.md' ] as const ).map((file) => ({ name: file, url: `https://raw.githubusercontent.com/fmhy/edit/main/docs/${file}` })) export default defineCachedEventHandler( async (event) => { let body = '\n' const contents = await Promise.all( files.map(async (file) => { const content = await $fetch(file.url) return content }) ) body += contents.join('\n\n') appendResponseHeaders(event, { 'content-type': 'text/markdown;charset=utf-8', 'cache-control': 'public, max-age=7200' }) return body }, { maxAge: 60 * 60, name: 'single-page', getKey: () => 'default' /* Can be extended in the future */ } )