Skip to main content

spa.config.json

The project configuration file, placed at the root of the lua_template directory.

Full schema

{
"page_title": "my_app",
"entry_component": "App",
"mount_id": "app",
"initial_props": {
"user": "guest"
},
"server": {
"host": "127.0.0.1",
"port": 8000
},
"router": {
"routes": [
{
"path": "/",
"component": "Home",
"props": {},
"children": [],
"index": false,
"guard": null,
"meta": {}
}
]
}
}

Fields

FieldTypeDefaultDescription
page_titlestring"lua-spa"HTML <title> tag value
entry_componentstring"App"Root component name (must exist in components/)
mount_idstring"app"DOM element ID where the app mounts
initial_propsobject{}Default props passed to the entry component
server.hoststring"127.0.0.1"Bind address
server.portnumber8000Port
routerobject | nullnullRouter configuration (see Router API)

Minimal config

{
"page_title": "hello",
"server": { "host": "0.0.0.0", "port": 3000 }
}

Config loading

LuaTemplateConfig is a frozen dataclass defined in lua_spa.types.