Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: typos

...

To create a channel for this purpose, in the UI go to the "Channels" tagtab. The type of this channel might be "web shortcut", and the name might match the first part of the path of the short URL. In the running example, this would be "/my.room".

...

by creating a channel of type "web shortcut" with name "/clear-temps", and registering this first path component (FPC) and the ECI with the root pico, as before, except that the type would be "event" rather than "query".

Note that the FPC "/clear-temps" can be chosen arbitrarily, because it is the event identifier (EID). Contrast this with the case for queries in which the name of the channel must match your ruleset identifier (RID). For events, the RID does not appear appears in either neither the longer standard URL nor in the short one.

...

This technique is most useful when you own and operate the node pico engine. When you own a pico that lives on an engine operated by someone else, there is a risk of inadvertent naming collisions of the FPC. The io.picolabs.rewrite ruleset in the root pico will detect a collision and not allow you to register a shortcut with an FPC that is already in use.

Of course, you really ought to operate your own pico engine. It's not that hard (see Pico Engine Quickstart) and it gives you more personal freedom. If you grant others access to your engine and allow them to have an owner pico (see Account management using the Root Pico), you might wish to set up some kind of registration procedure for naming web shortcuts, because these other owners will not have access to your root pico's "Testing" tab. This could be a simple single-page application (SPA) or a (shortened!) URL to the root pico for the rewrite:new_rewrite event expecting parameters named "fpc", "eci", and "type". This would allow registering the same event as above using a shortened URL like this.

Code Block
http://localhost:8080/register-rewrite/rewrite/new_rewrite?fpc=/clear-temps&eci=F6M33KHKhQWNJXpSu9cAM4&type=event

Like the longer, standard links for events and queries, the shorter links are not permalinks unless you take steps to keep your engine running permanently and never change the ECI. The shorter links would have more tendancy towards permanence because when deleting an ECI you can create a new channel (with proper name and type), and then registering it with the root pico, without requiring the link itself to change.

...