Internals
ReloadableMiddleware.Browser.browser — Methodbrowser(url)Opens the given url in the default browser. When the BROWSER environment variable is set to a Chromium-based browser and the platform is macOS then browser attempts to reuse an open tab for that url, otherwise it opens a new tab.
ReloadableMiddleware.Docs.middleware — MethodProvides API docs for all router modules that the user has defined.
ReloadableMiddleware.Errors.error_reporting_middleware — Methoderror_reporting_middleware(handler)When route handlers throws errors this middleware catches those and opens up the stacktrace in a separate browser tab. When clicking on file location links within the stacktrace the default EDITOR will be used to open that file at the correct location.
ReloadableMiddleware.Reloader.ReloaderMiddleware — FunctionReloaderMiddleware(; config...)Adding ReloaderMiddleware to a server middleware stack will cause the browser tab to refetch the page content whenever Revise detects source file changes. The newly fetched content will be merged into the current page content using the DOM morphing provided by https://github.com/bigskysoftware/idiomorph.
Add this middleware directly after ReviseMiddleware.
ReloadableMiddleware.Reviser.ReviseMiddleware — MethodReviseMiddleware(handler)Adding ReviseMiddleware to a server middleware stack will result in each request triggering a Revise.jl revision if there are unevaluated changes in any tracked files. Use alongside ReloaderMiddleware to auto-reload the browser on each change to the backend code.
Add this middleware at the very start of your server middleware stack. The ReloaderMiddleware should appear directly afterwards.
ReloadableMiddleware.Watcher.FolderWatcher — TypeFolderWatcher(callback; roots, start_dir, delay, skiplist)Monitor the provided roots directories recursively for changes. When new subdirectories are created they are added to the watch list. When directories are removed from the directory structure then watching is stopped on them.
rootsmust be an array of directory rootStrings.["."]by default.start_diris the directory to begin folder search from.pwd()by default.delayis the time in seconds between each triggered callback.0.1by default.skiplistdirectory names to avoid recursing into. By default.gitandnode_modules.
Stop watching by calling close on the FolderWatcher object.