Web Application Customisation
January 27, 2026 ยท View on GitHub
AntTP allows you to customise how your website or application behaves when hosted on the Autonomi Network. This is achieved through an app-config.json file.
The app-config.json File
By including an app-config.json file in your archive, you can define routing rules for your application. This is particularly useful for Single Page Applications (SPAs) like Angular, React, or Vue, which require all requests to be routed through a single entry point (usually index.html).
Example Configuration
{
"routeMap": {
"": "index.html",
"blog/*": "index.html",
"blog/*/article/*": "index.html"
}
}
Key Mapping Rules
- Empty Key (
""): Maps the root URL of the archive to a specific file (e.g., servingindex.htmlinstead of a directory listing). - Wildcards (
*): Allows you to map entire path patterns to a single file. For example,blog/*will serveindex.htmlfor any URL that starts withblog/. - Custom Paths: You can define any number of paths to suit your application's routing logic.
Why Use a Route Map?
- SPA Compatibility: Modern frameworks handle routing internally within the browser. The server needs to serve the main HTML file for any route the user might land on or refresh.
- Default Documents: It provides a way to serve an index page by default, creating a more traditional web experience.
- Clean URLs: It enables prettier URLs without needing to explicitly include
.htmlextensions or the full filename in every link.
Deployment Process
- Create your
app-config.jsonfile in your project's root directory. - Upload the directory as an archive to Autonomi.
- Access the archive address via AntTP and verify that the routing behaves as expected.
<< Previous | Up | Next >>