sveltekit-flyweb
v0.1.0
Published
FlyWeb integration for SvelteKit — serve structured data to AI agents.
Downloads
97
Maintainers
Readme
sveltekit-flyweb
FlyWeb integration for SvelteKit — serve structured data to AI agents.
Install
npm install sveltekit-flywebUsage
// src/routes/.well-known/flyweb.json/+server.ts
import { createHandler } from 'sveltekit-flyweb';
export const GET = createHandler({
flyweb: '1.0',
entity: 'My Blog',
type: 'blog',
attribution: { required: true, license: 'CC-BY-4.0', must_link: true },
resources: {
posts: {
path: '/.flyweb/posts',
format: 'jsonl',
fields: ['title', 'author', 'date', 'content'],
access: 'free',
},
},
});// src/routes/.flyweb/posts/+server.ts
import { createResourceHandler } from 'sveltekit-flyweb';
import { getAllPosts } from '$lib/posts';
export const GET = createResourceHandler({
format: 'jsonl',
source: getAllPosts,
queryable: ['tag', 'author'],
});Links
License
MIT
