Smallweb 0.9 - Improved Routing
by Achille Lacoin
1 min read
Updated Routing
After a lot of feedback shared by community, the routing was rethinked from the ground up. Thanks everyone for sharing your thoughts!
Here is what your smallweb root folder (which defaults to ~/smallweb
) should
now look like:
~/smallweb/
├── localhost
│ ├── example
│ │ └── main.ts
│ └── react
│ └── main.ts
├── pomdtr.me
│ └── www
│ └── main.ts
└── smallweb.run
├── www
│ └── main.ts
├── assets
│ └── main.ts
└── readme
└── main.ts
The first level of subfolder is the apex domain, and the second one is the subdomain.
https://assets.smallweb.run
will be routed to~/smallweb/smallweb.run/assets/
react.localhost
will be routed to~/smallweb/localhost/react/
Request targeting the apex domain will be automatically redirected to the www
subdomain.
You can read more about the design process in the dedicated blog post.
smallweb list
The smallweb dump command was renamed to smallweb list
.
Smallweb list supports both human and machine readable output (with a --json
flag).
You can filter by domain using the --domain
flag.
smallweb open
The smallweb open
command can now open smallweb websites, even when your
current directory is not the root of a smallweb app.
Just pass the app name to the command:
smallweb open react.localhost
The command provides completions, make sure to set them properly. You can get
shell specific instructions using the smallweb help completion
command.