mirror of
https://github.com/Smeagolworms4/MQTT-Explorer.git
synced 2026-09-15 11:03:11 +00:00
add mobile css
This commit is contained in:
@@ -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": "",
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
}
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
],
|
||||
"lib": ["es2015"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user