Entry configuration

Entry configuration

Entry configuration

Function

app.entry determines what page to load after the window starts. Its meaning is determined by app.mode.

static mode

static mode loads HTML files in the project:

The relative path is based on the project root directory. By default, index.html will be loaded as the root path when running:

. In this way, front-end routing such as Vue Router createWebHistory() can recognize the initial path as /. Other entry files will be converted according to the actual path. For example, pages/start.html will be converted to:

The path must be a relative path within the project, not an absolute path, and cannot contain ... When the entry resource does not exist, the window will display a startup error page, prompting 入口资源不存在.

server mode

server mode fixedly executes server.bt in the root directory of the project, and the window loads the HTTP address specified by app.entry:

In server.bt, you need to start the Web service yourself, and ensure that the listening address is consistent with app.entry. Currently it is recommended to use net.listen({ type:'web' }).

remote mode

remote mode directly loads the remote web address:

remote mode entry must start with http:// or https://.

Default

modeentry Default
staticindex.html
serverhttp://127.0.0.1:18280
remotehttps://example.com

bt:// address

Developers generally do not need to hand-write bt:// in app.entry. static mode automatically converts relative entries to bt://app/....

In static mode, paths without extensions will fall back to the entry HTML when the resource does not exist to support SPA history routing refresh; scripts, styles and images with extensions will not fall back. The

page can be referenced inside:

Troubleshooting

- The local entrance cannot be opened: check whether app.mode is static, whether the entry file exists, and whether the path does not contain ...

  • The local service cannot be opened: Check whether server.bt exists, whether the port is occupied, and whether the listening address of net.listen is consistent with app.entry.
  • The remote portal cannot be opened: Check whether the network, certificate, and URL can be opened in a normal browser.
  • The entry path cannot access files outside the project; both the development directory and Bundle will verify safe relative paths.