Developing and testing webapps/add-ons without leaving Node. here:
https://ramblings.mcpher.com/local-apps-script-webapp-and-ui-emulation/
Bringing the Web App HomeAt the heart of this update is the new
gas-fakes serve command. This command spins up a local HTTP endpoint that routes requests directly to your
doGet
or
doPost
and other server side functions. This emulates the Apps Script environment, enabling a “save and refresh” workflow that was previously impossible without constant cloud deployments.
Full EmulationThe local web server is not just a basic proxy; it includes deep support for the core components of GAS web development:
- HtmlService Templating: You can use standard templating syntax, such as <?!= myFunction() ?>, to manage your HTML assets locally.
- Client-side RPC: The google.script.run API is fully supported locally, ensuring your client-side scripts can communicate seamlessly with your server-side functions.
- Visual UI Framing: Calling SpreadsheetApp.getUi().showSidebar(html) will now automatically frame your HTML output inside a visually accurate Workspace-style sidebar directly in your local browser.