The Runtime
appnow.license is the complete application runtime. It handles request routing, configuration loading, template rendering, static file serving, security checks, and CLI operations — all in one file.
When a request comes in, the runtime reads your app's config from the appnow.json/ directory, determines the operating mode, checks for API routes, and dispatches accordingly. In app-server mode, it maps URLs to the content/ filesystem. In API modes, it dispatches to routes/.
Three Operating Modes
App Server
Serve complete websites with page routing, template rendering, and static file management. Your pages live in content/. The runtime provides built-in functions that include your HTML templates from content/html/ and inject CSS/JS automatically.
- URL-to-filesystem mapping via
routeRequest() - CSS auto-discovery from
content/html/css/ - JS auto-discovery from
content/html/js/ - Static file fallback:
content/{path}thencontent/html/{path} - ETag + Last-Modified + 304 Not Modified for static files
- Config-driven navigation, chat widget, branding
API Gateway
Route JSON API traffic through endpoint files in routes/. Every subdirectory becomes an API endpoint. Routes are dispatched before the mode switch, so they work in all three modes.
- Routes dispatched by URL path matching to
routes/directory - WebSocket transport for persistent connections
- Response encoding via
packJSONwith hour-based shift - Device registration auth (HTTP_KEY/HTTP_PAIR)
- Origin validation via
/.appnow/identify
Custom Service
Run specialized compute workloads — GPU rendering, AI inference, image processing. Same routing as API gateway, plus binary output via render/ endpoints served over HTTPS with proper caching headers.
- Binary output via
render/(images, PDFs, swatches) - CORS headers for cross-origin embedding
- Same
routes/+functions/architecture - Designed for GPU servers and heavy compute tasks
Directory Structure
appnow.license — the runtime
appnow.json/ — config directory tree
_.json — root app config
{route}/_.json — per-route config
routes/ — API endpoints (all modes)
render/ — binary output endpoints (HTTPS)
functions/ — function libraries
open/ — utilities
mightyjs/ — core platform (.license)
showroom/ — rendering (.license)
content/ — pages + templates (app-server)
html/ — templates + static assets
head — <head> template
nav — navigation template
footer — footer template
css/ — stylesheets (auto-discovered)
js/ — scripts (auto-discovered)
fonts/ — web fonts
images/ — static images
storage/ — data files, cache, uploads
logs/ — application logs
system/ — server configs, scripts
Configuration
App configuration lives in appnow.json/ as a directory tree. The root _.json file defines the app's identity, mode, paths, features, security, and branding. Subdirectories can override settings per route — for example, appnow.json/about/_.json can set a different page title and disable the chat widget for the about page.
The runtime walks the entire directory tree at startup and merges all config files. Route-specific settings are loaded on demand. Config is available globally to all pages and routes.
CLI Interface
The same runtime works from the command line. Every app can be inspected, tested, and diagnosed without a web server:
appnow.license --action health # App health check (JSON)
appnow.license --action config # Dump sanitized config
appnow.license --action services # List configured services
appnow.license --action test-route # Verify route resolves
appnow.license --action status # Full system diagnostic
appnow.license --help # All options
Deployment
Each app deploys to /srv/apps/{vhost_id}/ on the target server. The web server routes by domain name to the correct app directory. SSL is managed automatically. The appnow.service daemon handles privileged operations like vhost reloads and health checks.