class Lune::AssetServer

Overview

Serves embedded assets over HTTP on a random local port. Started in a fiber before the webview run loop so the webview can navigate to http://127.0.0.1: instead of using a data: URI. This gives the frontend a real origin — relative imports, fetch, and WebSocket HMR all work correctly.

Defined in:

lune/asset_server.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def port : Int32 #

[View source]
def start #

[View source]
def stop #

Call after wv.run returns to release the port and stop the fiber.


[View source]
def url : String #

[View source]