Web application routing
Overview
Routing for HTTP requests to the web server.
Used in addition to the system web server descriptor, organizing automatic redirects and substitutions when accessing certain pages.
For example, a request to /scripteditor is redirected to /scripteditor/. That in turn substitutes the content of /scripteditor/index.html without
redirection.
It is expected that url_routes.json will specify redirect and substitution pages for all system web applications included in the distribution.
[
{
"url": str,
"type": "redirect" | "static" | "static_dir_with_404",
"to": str,
"code": int,
"dir": str
},
...
]
| Field | Description |
|---|---|
|
relative-root URL to be routed. Supports wildcard ( |
|
routing mode:
|
|
new URL at which the resource is available. |
|
(for |
|
(for |
Example
[
{ "url": "/", "type": "static", "to": "/index.html" },
{ "url": "/login", "type": "static", "to": "/index.html" },
{ "url": "/doc", "type": "redirect", "to": "/doc/", "code": 301 },
{ "url": "/doc/", "type": "static", "to": "/doc/index.html" },
{ "url": "/selector", "type": "redirect", "to": "/selector/", "code": 301 },
{ "url": "/selector/", "type": "static", "to": "/selector_dist/index.html" },
{
"url": "/selector/*",
"type": "static_dir_with_404",
"to": "/selector_dist/index.html",
"dir": "/selector_dist/"
},
{ "url": "/scripteditor", "type": "redirect", "to": "/scripteditor/", "code": 301 },
{ "url": "/scripteditor/", "type": "static", "to": "/scripteditor/index.html" },
{ "url": "/webphone", "type": "redirect", "to": "/webphone/", "code": 301 },
{ "url": "/webphone/", "type": "static", "to": "/webphone/index.html" }
]