feat: add night shift focus panel and unified runtime
This commit is contained in:
+15
-3
@@ -1,8 +1,14 @@
|
||||
import express from 'express'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { checkBackendHealth, fetchStoredAppState, persistAppState } from './appwriteBackend.mjs'
|
||||
|
||||
const app = express()
|
||||
const port = Number(process.env.BUILDPULSE_API_PORT || 8788)
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const distDir = path.resolve(__dirname, '../dist')
|
||||
const port = Number(process.env.BUILDPULSE_PORT || process.env.BUILDPULSE_API_PORT || 3034)
|
||||
const host = process.env.BUILDPULSE_HOST || '127.0.0.1'
|
||||
|
||||
app.use(express.json({ limit: '2mb' }))
|
||||
|
||||
@@ -39,6 +45,12 @@ app.put('/api/state', async (req, res) => {
|
||||
}
|
||||
})
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`BuildPulse API listening on http://127.0.0.1:${port}`)
|
||||
app.use(express.static(distDir))
|
||||
|
||||
app.get('/{*path}', (_req, res) => {
|
||||
res.sendFile(path.join(distDir, 'index.html'))
|
||||
})
|
||||
|
||||
app.listen(port, host, () => {
|
||||
console.log(`BuildPulse listening on http://${host}:${port}`)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user