add mobile css

This commit is contained in:
SmeagolWorms4
2022-06-04 21:58:33 +02:00
parent 1bd65b6b7c
commit 8a1a0ca7ea
4 changed files with 207 additions and 4 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
"scripts": {
"build": "tsc",
"clean": "rm -rf dist",
"dev": "npm run clean && tsc-watch --onSuccess \"npm run start\"",
"dev": "npm run clean && tsc-watch --noClear --onSuccess \"npm run start\"",
"start": "node dist/node-server/server/src/index.js"
},
"author": "",
+10 -3
View File
@@ -109,13 +109,20 @@ if (httpUser && httpPassword) {
ipcSocketIo.init(io)
const staticDir = path.resolve(__dirname, '../../../../../../app/build-browser')
app.use(express.static(staticDir))
const assetsDir = path.resolve(__dirname, '../../../../../assets')
app.get('/', (req, res) => {
res.header('content-type', 'text/html').send(fs.readFileSync(path.resolve(staticDir, 'index.html')))
let content = fs.readFileSync(path.resolve(staticDir, 'index.html')).toString()
content = content.replace('</body>', '<link rel="stylesheet" href="./mobile.css" /></body>')
res.header('content-type', 'text/html').send(content)
})
app.get('/mobile.css', (req, res) => {
res.header('content-type', 'text/css').send(fs.readFileSync(path.resolve(assetsDir, 'mobile.css')))
})
app.use(express.static(staticDir))
const connectionManager = new ConnectionManager()
connectionManager.manageConnections()
+2
View File
@@ -11,6 +11,8 @@
}
},
"exclude": [
"node_modules",
"dist"
],
"lib": ["es2015"]
}