serve a static website from your pds
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update readme

+21 -31
+14 -30
README.md
··· 1 - # sv 2 - 3 - Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli). 4 - 5 - ## Creating a project 6 - 7 - If you're seeing this, you've probably already done this step. Congrats! 8 - 9 - ```sh 10 - # create a new project in the current directory 11 - npx sv create 12 - 13 - # create a new project in my-app 14 - npx sv create my-app 15 - ``` 1 + # athost 16 2 17 - ## Developing 18 - 19 - Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: 20 - 21 - ```sh 22 - npm run dev 3 + An experimental web host built on atproto. 23 4 24 - # or start the server and open the app in a new browser tab 25 - npm run dev -- --open 26 - ``` 5 + Nothing has been formalized yet. Right now, a website is stored as a "bundle" record that looks something like this: 27 6 28 - ## Building 7 + ```ts 8 + interface Bundle { 9 + /** The timestamp at which the latest version of the bundle was created. */ 10 + createdAt: string; 29 11 30 - To create a production version of your app: 12 + /** Human-readable summary of the deploy; notes, commit message, etc. */ 13 + description?: string; 31 14 32 - ```sh 33 - npm run build 15 + /** A map of asset paths to blob references. */ 16 + assets: Record<string, { $type: "blob"; ref: { $link: string }; mimeType: string; size: number }>; 17 + } 34 18 ``` 35 19 36 - You can preview the production build with `npm run preview`. 20 + To deploy a new version, upload the relevant blobs and update the record. 37 21 38 - > To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. 22 + To serve the website, you need some sort of proxy server that fetches the appropriate files from the PDS when requests come in. `proxy.js` is a small (~150 line) example server.
+7 -1
src/lib/atproto.ts
··· 4 4 import type { Did } from "@atcute/lexicons"; 5 5 6 6 export interface Bundle { 7 + /** The timestamp at which the latest version of the bundle was created. */ 8 + createdAt: string; 9 + 10 + /** Human-readable summary of the deploy; notes, commit message, etc. */ 7 11 description?: string; 12 + 13 + /** A map of asset paths to blob references. */ 8 14 assets: Record<string, { $type: "blob"; ref: { $link: string }; mimeType: string; size: number }>; 15 + 9 16 fallback?: { 10 17 path: string; 11 18 status?: number; 12 19 }; 13 - createdAt: string; 14 20 } 15 21 16 22 export default class ATProto {