The standard behavior of
dweb:// is to serve whichever file is referenced by the URL. This works fine for simple use-cases but can struggle in several areas, including:
- Sites which need a consistent theme and template applied across each page.
- Applications which need to serve interfaces even where a file does not exist (as in the Single Page Application pattern).
How Frontends Work
Frontend is simply an html file found at
/.ui/ui.html. This file is used to provide a consistent interface for the site. It is served rather than the target file in the following cases:
- No file exists at the target URL or if the target URL is a folder
Acceptheader includes text/html (which indicates dBrowser is asking for a
window.location.pathname and then place that in the UI.
Here is an example:
An advantage of Frontends is that they are stored in a subfolder. This makes it possible for fontends to be their own dDrive sites which are mounted to
Frontend dDrives can therefore be published and shared by multiple sites or applications.