?

The ? suffix opens the source of a deployed page in RTCode.io, exactly as it was when you deployed it: the code, routes, editors, title, layout, selections and folds.

Syntax

plain
https://name.rt.ht/?
https://name.rt.ht/docs/?
https://name.rt.ht/nav.js?io
https://name.rt.ht/docs/?sync

Write the ? directly after a slash. The aliases ?io and ?sync work on any path of the route, files included.

Parameters

?

The raw request URL ends in /?. https://name.rt.ht/? and https://name.rt.ht/docs/? open the source of the route that serves the URL.

?io, ?sync Experimental

The query is exactly ?io or ?sync, on any path of the route, including file URLs such as /nav.js?io. The match is exact: ?io= and ?IO do not match. For a private source, use the plain ? form: it returns to the source after sign-in.

::i, ::e, ::c Experimental

A path that ends in ::i, ::e or ::c, optionally followed by word characters (::io, ::edit, ::code), answers with a 303 to the same path with ?. The original query is dropped: /::i becomes /?, and /docs/::e becomes /docs/?.

Response

CaseStatusBody or target
Public source, or a permitted visitor200A short HTML page that opens the saved playground URL in RTCode.io.
Private source, anonymous visitor303Location: <path>::sit?. The visitor signs in and returns to ?.
Private source, signed in without permission403The page "You are not authorized.", with a "Sign in as a different user" link (::sa).
Route not deployed404"Code does not exist.", with a "Sign in to deploy" link, or "Deploy your code here" when signed in.

The 200 response has Content-Type: text/html;charset=utf-8 and Cache-Control: no-store. Its body holds generated social tags and <meta http-equiv=refresh content="0;url=<playground URL>">. A meta refresh is not an HTTP redirect, so link-preview bots read the tags instead of following it.

Social tags

og:title is "π—₯𝗧𝗖𝗼𝗱𝗲.𝗢𝗼 ⚑ ← 🌐 RTEdge.net". og:image is the deploy screenshot of the request URL without its query, 1200 by 630 (og:image:width and og:image:height). og:description and description are the playground Title, or the hostname when there is no Title.

Refresh target

The playground URL that was saved when you deployed, with its whole state, so the editor opens as you left it: routes, editors, title, layout, selections and folds. When the hash is 8,192 characters or longer and the saved URL is an RTCode.io editor URL, RTEdge.net compacts it to #v=2&c=… (gzip, base64url) if that is shorter.

Access

Anyone can use ? without signing in, unless the deployment has one of these:

When the source is private, the owner, the editors and the permits of io:user attributes, on ordinary elements and on edge workers, may open it. A permit matches the exact email, the viewer's email domain, or * for any signed-in user. edge:user permits do not grant source access.

The check runs after RTEdge.net has read the deployment, and before the edge:user check, the exported files and the root page. See io:user, io:guest and how the two gates combine.

What the source contains

? shows the full authored source as saved at deploy time. That includes what the served HTML leaves out: elements removed or redacted with edge:remove and edge:redact, every <script type=worker>, and all i:, o:, io:, edge:, h: and worker: attributes. Redaction is therefore not secrecy on a route with a public source. See Keeping secrets out of deployments.

Examples

html
<a href=?>View source</a>

A relative ? resolves against the page's directory, so on https://name.rt.ht/docs/ the link opens https://name.rt.ht/docs/?. The gateway form https://in.rt.ht/<route>/? opens the same source. See in.rt.ht.

Show an edit link only to the owner

html
<a id=edit href=? hidden>Edit this page</a>
<script type=module>
  edit.hidden = await fetch('?m=uo').then(r => r.text()) !== 'true'
</script>

?m=uo answers null, true or false as text. See ?m=uo. Avoid this check on routes that may not be deployed yet.

Specifications

Not part of any specification. ? is an RTEdge.net feature. The response uses these standards:

Specification
<meta http-equiv=refresh> (HTML Standard)
The Open Graph protocol
HTTP Semantics (RFC 9110), for the 303, 403 and 404 responses

Availability

FeaturePlaygroundRTEdge.netNotes
?NoYesA feature of the RTEdge.net router. The playground output does not implement it.
?io, ?sync ExperimentalNoYesAliases of ? for any path of the route.
::i, ::e, ::c ExperimentalNoYesPlatform shortcuts that redirect to ?.

See also