mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-10 07:31:09 +08:00
Revert v3 changes in v2 asset server
This commit is contained in:
parent
ec0731d5d8
commit
543b18dd54
@ -15,11 +15,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
runtimeJSPath = "/wails/runtime.js"
|
runtimeJSPath = "/wails/runtime.js"
|
||||||
ipcJSPath = "/wails/ipc.js"
|
ipcJSPath = "/wails/ipc.js"
|
||||||
runtimePath = "/wails/runtime"
|
runtimePath = "/wails/runtime"
|
||||||
capabilitiesPath = "/wails/capabilities"
|
|
||||||
flagsPath = "/wails/flags"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type RuntimeAssets interface {
|
type RuntimeAssets interface {
|
||||||
@ -49,12 +47,6 @@ type AssetServer struct {
|
|||||||
// plugin scripts
|
// plugin scripts
|
||||||
pluginScripts map[string]string
|
pluginScripts map[string]string
|
||||||
|
|
||||||
// GetCapabilities returns the capabilities of the runtime
|
|
||||||
GetCapabilities func() []byte
|
|
||||||
|
|
||||||
// GetFlags returns the application flags
|
|
||||||
GetFlags func() []byte
|
|
||||||
|
|
||||||
assetServerWebView
|
assetServerWebView
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,20 +145,6 @@ func (d *AssetServer) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
|||||||
case runtimeJSPath:
|
case runtimeJSPath:
|
||||||
d.writeBlob(rw, path, d.runtimeJS)
|
d.writeBlob(rw, path, d.runtimeJS)
|
||||||
|
|
||||||
case capabilitiesPath:
|
|
||||||
var data = []byte("{}")
|
|
||||||
if d.GetCapabilities != nil {
|
|
||||||
data = d.GetCapabilities()
|
|
||||||
}
|
|
||||||
d.writeBlob(rw, path, data)
|
|
||||||
|
|
||||||
case flagsPath:
|
|
||||||
var data = []byte("{}")
|
|
||||||
if d.GetFlags != nil {
|
|
||||||
data = d.GetFlags()
|
|
||||||
}
|
|
||||||
d.writeBlob(rw, path, data)
|
|
||||||
|
|
||||||
case runtimePath:
|
case runtimePath:
|
||||||
if d.runtimeHandler != nil {
|
if d.runtimeHandler != nil {
|
||||||
d.runtimeHandler.HandleRuntimeCall(rw, req)
|
d.runtimeHandler.HandleRuntimeCall(rw, req)
|
||||||
|
Loading…
Reference in New Issue
Block a user