feat(launcher-spawn): improve URL instructions

This commit is contained in:
Ben Allfree
2024-06-27 14:09:27 -07:00
parent b4b0cf98d3
commit 40d8b8bc33
2 changed files with 15 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
---
'@pockethost/plugin-launcher-spawn': patch
---
Enhancement: improve URL instructions

View File

@@ -68,11 +68,17 @@ const plugin: PocketHostPlugin = async ({}) => {
/** Display some informational alerts to help the user get started. */
onAfterServerStartAction(async () => {
info(`Listening for requests on *.${APEX_DOMAIN()}`)
const protocol = PORT() === 443 ? 'https' : 'http'
const url = new URL(`${protocol}://hello.${APEX_DOMAIN()}`)
url.port = `${PORT() === 80 || PORT() == 443 ? '' : PORT()}`
info(`Try visiting ${url}`)
{
const url = new URL(`${protocol}://*.${APEX_DOMAIN()}`)
url.port = `${PORT() === 80 || PORT() == 443 ? '' : PORT()}`
info(`Listening for requests on ${url}`)
}
{
const url = new URL(`${protocol}://hello.${APEX_DOMAIN()}`)
url.port = `${PORT() === 80 || PORT() == 443 ? '' : PORT()}`
info(`Try visiting ${url}`)
}
})
/** When a request comes in, return an instance based on subdomain */