simplified logic

This commit is contained in:
Harsh Mahajan
2025-11-10 07:37:56 +00:00
parent aea5fe4cba
commit 82438c2a9c
@@ -68,6 +68,8 @@ ${prefix}APPWRITE_ENDPOINT = "${sdk.forProject(page.params.region, page.params.p
let hostname = $state(null);
let hostnameError = $state(false);
const hostnameRegex = new RegExp(extendedHostnameRegex);
let frameworks: Array<FrameworkType> = [
{
key: 'svelte',
@@ -158,9 +160,8 @@ ${prefix}APPWRITE_ENDPOINT = "${sdk.forProject(page.params.region, page.params.p
);
async function createWebPlatform() {
const trimmedHostname = hostname?.trim() || '';
const finalHostname = trimmedHostname !== '' ? trimmedHostname : 'localhost';
hostnameError = !new RegExp(extendedHostnameRegex).test(finalHostname);
const finalHostname = hostname?.trim() || 'localhost';
hostnameError = !hostnameRegex.test(finalHostname);
if (hostnameError) {
return;