Skip to content

Veyra Live Server 1.4.0: phone testing, browser console, API proxy, S… - #31

Merged
fcopensource merged 1 commit into
mainfrom
live-server-1.4
Nov 15, 2026
Merged

fcopensource merged 1 commit into
mainfrom
live-server-1.4

Conversation

@fcopensource

Copy link
Copy Markdown
Owner

…PA mode

  • Keeps your place: after a live reload the page returns to the same scroll position (in the shared browser script, so Veyra Studio gets it too).
  • Browser console in VS Code: console.log, warnings, errors and unhandled promise rejections from the page appear in a new "Browser Console" output, with an error count in the status bar. The script is injected at the top of in this mode so it hears every message; Veyra Studio's injection is unchanged.
  • Test on your phone: "Share on Your Network" serves on the LAN (off by default, asks once), shows and copies the network address.
  • API proxy (veyraLiveServer.proxy): any method, path, query and body, streamed, with a clear 502 page when the backend is down.
  • Single-page apps (veyraLiveServer.spa): routes get the root index.html.
  • Smarter reloads: only changes inside the served folder count, plus veyraLiveServer.ignore globs.
  • Changing any of these settings restarts Live Server.
  • README, changelog and veyraeditor.com/live-server updated.

Tests: 15 server tests (7 new, with a real backend for the proxy), a browser run in Chromium (console forwarding, scroll restore, CSS swap) and the integration test in VS Code 1.144.

…PA mode

- Keeps your place: after a live reload the page returns to the same scroll
  position (in the shared browser script, so Veyra Studio gets it too).
- Browser console in VS Code: console.log, warnings, errors and unhandled
  promise rejections from the page appear in a new "Browser Console" output,
  with an error count in the status bar. The script is injected at the top of
  <head> in this mode so it hears every message; Veyra Studio's injection is
  unchanged.
- Test on your phone: "Share on Your Network" serves on the LAN (off by
  default, asks once), shows and copies the network address.
- API proxy (veyraLiveServer.proxy): any method, path, query and body,
  streamed, with a clear 502 page when the backend is down.
- Single-page apps (veyraLiveServer.spa): routes get the root index.html.
- Smarter reloads: only changes inside the served folder count, plus
  veyraLiveServer.ignore globs.
- Changing any of these settings restarts Live Server.
- README, changelog and veyraeditor.com/live-server updated.

Tests: 15 server tests (7 new, with a real backend for the proxy), a browser
run in Chromium (console forwarding, scroll restore, CSS swap) and the
integration test in VS Code 1.144.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
const text = html.toString("latin1").toLowerCase(); // latin1 keeps byte offsets
let index = -1;
if (withConsole) {
const head = /<head(\s[^>]*)?>/.exec(text);
if (!urlPath.endsWith("/")) return reply(301, { Location: urlPath + "/" });
const index = ["index.html", "index.htm"].map(name => path.join(file, name)).find(p => fs.existsSync(p) && fs.statSync(p).isFile());
if (index) return reply(200, { "Content-Type": mime(index) }, inject(fs.readFileSync(index)));
const index = ["index.html", "index.htm"].map(name => path.join(file!, name)).find(p => fs.existsSync(p) && fs.statSync(p).isFile());
if (!urlPath.endsWith("/")) return reply(301, { Location: urlPath + "/" });
const index = ["index.html", "index.htm"].map(name => path.join(file, name)).find(p => fs.existsSync(p) && fs.statSync(p).isFile());
if (index) return reply(200, { "Content-Type": mime(index) }, inject(fs.readFileSync(index)));
const index = ["index.html", "index.htm"].map(name => path.join(file!, name)).find(p => fs.existsSync(p) && fs.statSync(p).isFile());
const index = ["index.html", "index.htm"].map(name => path.join(file, name)).find(p => fs.existsSync(p) && fs.statSync(p).isFile());
if (index) return reply(200, { "Content-Type": mime(index) }, inject(fs.readFileSync(index)));
const index = ["index.html", "index.htm"].map(name => path.join(file!, name)).find(p => fs.existsSync(p) && fs.statSync(p).isFile());
if (index) return reply(200, { "Content-Type": mime(index) }, inject(fs.readFileSync(index), withConsole));
}
if (isHtml(file)) return reply(200, { "Content-Type": mime(file) }, inject(fs.readFileSync(file)));
file = file!;
if (isHtml(file)) return reply(200, { "Content-Type": mime(file) }, inject(fs.readFileSync(file), withConsole));
@fcopensource
fcopensource merged commit 453a2f6 into main Nov 15, 2026
12 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants