Smallweb Demo
Learn more about smallweb at smallweb.run.
I've tried to protect this demo from the most common attacks, but please don't explicitly try to break it (that's just rude). If the demo is down, please report it to me on bluesky, discord.
Creating your own app
Open the editor at vscode.smallweb.club
Create a new folder in the root directory (ex:
/myapp/).Create the
/myapp/main.tsxfile in the new folder with the following content:/** @jsxImportSource https://esm.sh/preact */ import { render } from "npm:preact-render-to-string"; export default { fetch: (_req: Request) => new Response(render(<div>Hello from smallweb! </div>), { headers: { "Content-Type": "text/html", }, }), run: (_args: string[]) => { console.log("Hello from smallweb!"); }, }Go the https://myapp.smallweb.club to preview your website.
Accessing the smallweb cli
You can access the smallweb cli by using: ssh -p 2222 [email protected] help.
And trigger your app cli from the command line using:
$ ssh -p 2222 <myapp>@ssh.smallweb.club`
Hello from smallweb!Add the following snippet to your ssh config at ~/.ssh/config:
Host smallweb.club
HostName ssh.smallweb.club
LogLevel ERROR
Port 2222
User _
RequestTTY yesIt will shorten the command above to ssh smallweb.club !
You can use any sftp client to edit your files. For example, using lftp:
lftp sftp://smallweb.clubOr edit it using vim:
vim scp://smallweb.club/myapp/main.tsxOr even mount the filesystem using sshfs, and edit files from your preferred editor:
mkdir ~/smallweb.club
sshfs smallweb.club:/ ~/smallweb.clubExample
- Excalidraw (sources in the
/excalidrawfolder) - Smallblog (sources in the
/smallblogfolder) - Invoice (sources in the
/invoicefolder)
You can list all existing websites by going to ls.smallweb.club.