Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { Alert, Code } from '$lib/components';
import { WizardStep } from '$lib/layout';
import { sdkForProject } from '$lib/stores/sdk';
import { Mode, MODE } from '$lib/system';

const { endpoint, project } = sdkForProject.client.config;
const code = `import Appwrite
Expand All @@ -10,6 +11,8 @@ let client = Client()
.setEndpoint("${endpoint}")
.setProject("${project}")
.setSelfSigned(status: true) // For self signed certificates, only use for development`;

let showAlert = true;
</script>

<WizardStep>
Expand All @@ -25,13 +28,18 @@ let client = Client()
Before sending any API calls to your new Appwrite project, make sure your device or emulator
has network access to your Appwrite project's hostname or IP address.
</p>
<div class="common-section">
<Alert type="info">
<svelte:fragment slot="title">For self-hosted solutions</svelte:fragment>
When connecting to a locally hosted Appwrite project from an emulator or a mobile device,
you should use the private IP of the device running your Appwrite project as the hostname
of the endpoint instead of localhost. You can also use a service like ngrok to proxy the
Appwrite server.
</Alert>
</div>
{#if showAlert}
<div class="common-section">
<Alert
type="info"
dismissible={MODE === Mode.CLOUD}
on:dismiss={() => (showAlert = false)}>
<svelte:fragment slot="title">For self-hosted solutions</svelte:fragment>
When connecting to a locally hosted Appwrite project from an emulator or a mobile device,
you should use the private IP of the device running your Appwrite project as the hostname
of the endpoint instead of localhost. You can also use a service like ngrok to proxy
the Appwrite server.
</Alert>
</div>
{/if}
</WizardStep>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import { Alert, Code } from '$lib/components';
import { WizardStep } from '$lib/layout';
import { sdkForProject } from '$lib/stores/sdk';
import { Mode, MODE } from '$lib/system';

const { endpoint, project } = sdkForProject.client.config;
const code = `import 'package:appwrite/appwrite.dart';
Expand All @@ -11,6 +12,8 @@ client
.setEndpoint('${endpoint}')
.setProject('${project}')
.setSelfSigned(status: true); // For self signed certificates, only use for development`;

let dismissedAlert = false;
Comment thread
TorstenDittmann marked this conversation as resolved.
Outdated
</script>

<WizardStep>
Expand All @@ -26,13 +29,18 @@ client
Before sending any API calls to your new Appwrite project, make sure your device or emulator
has network access to your Appwrite project's hostname or IP address.
</p>
<div class="common-section">
<Alert type="info">
<svelte:fragment slot="title">For self-hosted solutions</svelte:fragment>
When connecting to a locally hosted Appwrite project from an emulator or a mobile device,
you should use the private IP of the device running your Appwrite project as the hostname
of the endpoint instead of localhost. You can also use a service like ngrok to proxy the
Appwrite server.
</Alert>
</div>
{#if !dismissedAlert}
<div class="common-section">
<Alert
type="info"
dismissible={MODE === Mode.CLOUD}
on:dismiss={() => (dismissedAlert = true)}>
<svelte:fragment slot="title">For self-hosted solutions</svelte:fragment>
When connecting to a locally hosted Appwrite project from an emulator or a mobile device,
you should use the private IP of the device running your Appwrite project as the hostname
of the endpoint instead of localhost. You can also use a service like ngrok to proxy
the Appwrite server.
</Alert>
</div>
{/if}
</WizardStep>