server: put app assets in a private folder to let users use "client" and "assets" as folder names
This commit is contained in:
parent
534b6e90fc
commit
1368a109c2
3 changed files with 12 additions and 11 deletions
|
|
@ -5,6 +5,7 @@
|
|||
- bug fixes
|
||||
- custom module's submodules not loading their own submodules with relative paths properly
|
||||
- harmless error message when importing css files from the main theme file
|
||||
- allow using folder names "client" and "assets" for user files (eg for images used in a session)
|
||||
|
||||
## 1.16.2
|
||||
|
||||
|
|
|
|||
|
|
@ -6,14 +6,14 @@
|
|||
<meta name="mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<link rel="apple-touch-icon" href="../assets/logo.png?version=${version}" />
|
||||
<link rel="stylesheet" type="text/css" href="../assets/open-stage-control.css?version=${version}" hot-reload/>
|
||||
<link rel="stylesheet" type="text/css" href="../theme.css?version=${version}" hot-reload/>
|
||||
<link rel="stylesheet" type="text/css" href="../assets/fonts/fontawesome.min.css?version=${version}"/>
|
||||
<link rel="stylesheet" type="text/css" href="../assets/fonts/fa-solid.css?version=${version}"/>
|
||||
<link rel="stylesheet" type="text/css" href="../assets/fonts/roboto.css?version=${version}"/>
|
||||
<link rel="shortcut icon" href="../assets/favicon.png?version=${version}"/>
|
||||
<script src="../client/open-stage-control-client.js?version=${version}"></script>
|
||||
<link rel="apple-touch-icon" href="__APP__/assets/logo.png?version=${version}" />
|
||||
<link rel="stylesheet" type="text/css" href="__APP__/assets/open-stage-control.css?version=${version}" hot-reload/>
|
||||
<link rel="stylesheet" type="text/css" href="__APP__/theme.css?version=${version}" hot-reload/>
|
||||
<link rel="stylesheet" type="text/css" href="__APP__/assets/fonts/fontawesome.min.css?version=${version}"/>
|
||||
<link rel="stylesheet" type="text/css" href="__APP__/assets/fonts/fa-solid.css?version=${version}"/>
|
||||
<link rel="stylesheet" type="text/css" href="__APP__/assets/fonts/roboto.css?version=${version}"/>
|
||||
<link rel="shortcut icon" href="__APP__/assets/favicon.png?version=${version}"/>
|
||||
<script src="__APP__/client/open-stage-control-client.js?version=${version}"></script>
|
||||
</head>
|
||||
|
||||
<body class="editor-disabled">
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ function httpRoute(req, res) {
|
|||
|
||||
} else {
|
||||
|
||||
if (url.indexOf('theme.css') != -1) {
|
||||
if (url.indexOf('__APP__/theme.css') != -1) {
|
||||
|
||||
res.setHeader('Content-Type', 'text/css')
|
||||
if (settings.read('theme')) {
|
||||
|
|
@ -112,11 +112,11 @@ function httpRoute(req, res) {
|
|||
}
|
||||
res.end()
|
||||
|
||||
} else if (/^\/(assets|client)\//.test(url)){
|
||||
} else if (/^\/__APP__\//.test(url)){
|
||||
|
||||
if (prod) res.setHeader('Cache-Control', 'public, max-age=2592000')
|
||||
try {
|
||||
res.sendFile(path.resolve(__dirname + '/..' + url))
|
||||
res.sendFile(path.resolve(__dirname + '/..' + url.replace('__APP__', '')))
|
||||
return true
|
||||
} catch(e) {}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue