/** * `GET /:room`, `GET /:template/form`, `GET /:template/appeditor` — * Phase 4.1 entry routes. * * Legacy (src/main.ls:277-294): * * ```livescript * @get "#BASEPATH/:room": -> * room = encodeURI(@params.room) * ui-file = if room is /^=/ then \multi/index.html else \index.html * if KEY then * if @query.auth?length * sendFile(ui-file).call @ * else @response.redirect "#BASEPATH/#{ @params.room }?auth=0" * else sendFile(ui-file).call @ * * @get "#BASEPATH/:template/form": -> * template = encodeURI(@params.template) * room = template + \_ + new-room! * delete SC[room] * {snapshot} <~ SC._get template, IO * <~ SC._put room, snapshot * @response.redirect "#BASEPATH/#room/app" * * @get "#BASEPATH/:template/appeditor": sendFile \panels.html * ``` * * This module owns the two pure-logic parts: * * 1. `buildRoomEntry` — decides "serve `/index.html`", "serve * `/multi/index.html`", or "302 to `?auth=0`" based on the KEY / * `?auth` query state. * * 2. `buildTemplateFormRedirect` — produces the shape legacy emits * when `/some-template/form` is hit. Full implementation depends * on Phase 5 Room CRUD — specifically, cloning the template's * snapshot into `