Launch Playlet from web app
This commit is contained in:
1 parent
d65f930247
commit
2a57cc99c7
4 files changed
+35
-7
No files matched your search
@@ -0,0 +1,10 @@
|
||||
import { getIp } from "./Host";
|
||||
|
||||
export class ExternalControlProtocol {
|
||||
static async launchApp(appId) {
|
||||
return fetch(`http://${getIp()}:8060/launch/${appId}`, {
|
||||
method: 'POST',
|
||||
body: '',
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -3,4 +3,9 @@ function getHost() {
|
||||
return urlSearchParams.get('host') ?? window.location.host
|
||||
}
|
||||
|
||||
export { getHost }
|
||||
function getIp() {
|
||||
const host = getHost()
|
||||
return host.split(':')[0]
|
||||
}
|
||||
|
||||
export { getHost, getIp }
|
||||
Reference in new issue
Block a user