Implement wiring hardening, runtime API config, smoke tests, and build scripts
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
const { contextBridge, ipcRenderer } = require('electron')
|
||||
|
||||
contextBridge.exposeInMainWorld('ENV', {
|
||||
API_URL: process.env.VITE_API_URL || 'http://localhost:4000/api'
|
||||
API_URL: process.env.VITE_API_URL || 'http://localhost:4000/api',
|
||||
API_KEY: process.env.WRITE_API_KEY || process.env.VITE_WRITE_API_KEY || ''
|
||||
})
|
||||
|
||||
contextBridge.exposeInMainWorld('app', {
|
||||
@@ -10,5 +11,13 @@ contextBridge.exposeInMainWorld('app', {
|
||||
set: (key, value) => ipcRenderer.invoke('storage-set', key, value),
|
||||
remove: (key) => ipcRenderer.invoke('storage-remove', key)
|
||||
},
|
||||
getAPIUrl: () => ipcRenderer.invoke('get-api-url')
|
||||
getAPIUrl: () => ipcRenderer.invoke('get-api-url'),
|
||||
setAPIUrl: (url) => ipcRenderer.invoke('set-api-url', url)
|
||||
})
|
||||
|
||||
// Backward-compatible alias used by the React app persistence wrapper.
|
||||
contextBridge.exposeInMainWorld('storage', {
|
||||
get: (key) => ipcRenderer.invoke('storage-get', key),
|
||||
set: (key, value) => ipcRenderer.invoke('storage-set', key, value),
|
||||
remove: (key) => ipcRenderer.invoke('storage-remove', key)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user