welcome to your Smallweb 👋

hosted by SidePro 💙
deployment instructions

Creating a site / app / domain with Smallweb is as simple as creating a directory. This installation hosts two domains: www. (this page) and example.. You can view the source for both here.

Out of the box, you also get webdav., cli. and an editor. app, which you can use to manage your entire Smallweb installation. To make use of these you'll need to generate a token, which you can do using SidePro's exec. You generally only need to exec once. After that you can use the cli. endpoint to manage tokens, as well as most everything else.

% sidepro app exec ndyg-smallweb

🚢  Executing a shell
Namespace: andy-beta
Application: ndyg-smallweb

smallweb@rndyg-smallweb-5a:~$ smallweb token
Manage api tokens

Usage:
  smallweb token [command]

Available Commands:
  create      Create a new token
  list        List all tokens
  remove      Remove a token

Flags:
  -h, --help   help for token

Use "smallweb token [command] --help" for more information about a command.

smallweb@rndyg-smallweb-5a:~$ smallweb token create
smallweb_pat_H3cn # <-- TAKE A COPY OF YOUR TOKEN

smallweb@rndyg-smallweb-5a:~$ smallweb token list
H3cngOQstX4vfbjH        N/A     2024-09-10 17:13:49

Using these three built-in apps looks like this:

cli.<your-installations-domain>

You can run smallweb cli commands by sending POST requests. The query path is turned into the positional arguments for the command:

% curl -X POST https://"$SMALLWEB_TOKEN"@cli.smallweb.ndyg.co/token/list
H3cngOQstX4vfbjH        N/A     2024-09-10 17:13:49

For tooling you can also get the response as structured JSON

% curl -X POST "https://"$SMALLWEB_TOKEN"@cli.smallweb.ndyg.co/list?json" | jq
[
  {
    "name": "example",
    "dir": "~/smallweb/example",
    "urls": [
      "https://example.smallweb.ndyg.co"
    ]
  },
  {
    "name": "www",
    "dir": "~/smallweb/www",
    "urls": [
      "https://www.smallweb.ndyg.co"
    ]
  }
]

If you visit your cli. app in a browser, thanks to xterm.js, you'll get an interactive session you can issue smallweb commands. Use your access token as the auth username.

You can even invoke TUIs via the cli. app in a browser. This is a screenshot of running smallweb config to edit your installation's config in a browser. Rowdy!

webdav.<your-installations-domain>

You can mount your Smallweb installation as a local drive, and then edit your apps locally, using your preferred tools.

editor.<your-installations-domain>

You can use the built-in editor. app to edit your apps on the go. It uses CodeMirror to try and get the best experience on mobile devices.

(screenshot coming soon)