Skip to content

Commit 9ea2898

Browse files
committed
Fixes instructions for connection param
1 parent 4ab8e34 commit 9ea2898

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

docs/index.html

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ <h2 id="usage">Usage</h2>
231231
-H <span class="hljs-string">'Content-Type: application/json'</span> \
232232
-H <span class="hljs-string">'pg: {}'</span> <span class="hljs-comment"># see Postgres connection header below</span>
233233
</code></pre>
234-
<pre class="highlight tab tab-js"><code><span class="hljs-keyword">const</span> data = <span class="hljs-keyword">await</span> fetch(<span class="hljs-string">'https://pg-api.fly.dev'</span>, {
234+
<pre class="highlight tab tab-js"><code><span class="hljs-keyword">const</span> data = <span class="hljs-keyword">await</span> fetch(<span class="hljs-string">'http://localhost:1337'</span>, {
235235
<span class="hljs-attr">method</span>: <span class="hljs-string">'GET'</span>,
236236
<span class="hljs-attr">headers</span>: {
237237
<span class="hljs-string">'Content-Type'</span>: <span class="hljs-string">'application/json'</span>,
@@ -243,15 +243,11 @@ <h2 id="usage">Usage</h2>
243243
<p>Postgres connection header</p>
244244
</blockquote>
245245
<pre class="highlight tab tab-json"><code>{
246-
<span class="hljs-attr">"user"</span>: <span class="hljs-string">"postgres"</span>,
247-
<span class="hljs-attr">"password"</span>: <span class="hljs-string">"postgres"</span>,
248-
<span class="hljs-attr">"port"</span>: <span class="hljs-number">5432</span>,
249-
<span class="hljs-attr">"host"</span>: <span class="hljs-string">"db.domain.com"</span>
246+
<span class="hljs-attr">"X-Connection-Encrypted"</span>: <span class="hljs-string">"ENCRYPTED_CONNECTION_STRING"</span>
250247
}
251248
</code></pre>
252-
<p>For security reasons, this API is best self-hosted. However, we provide an example API for you to test before installing. To use the API however, you have to send your PG connection via HTTPS headers.</p>
253-
<p>We DO NOT log these headers anywhere. But still, we HIGHLY recommend that you just self-host (we have tried to make this easy for you). Use the demo API at your own risk.</p>
254-
<p>Database connection headers are not required for self-hosting. You can set ENV vars with your default connection details so that you don't pass connection details over a network.</p>
249+
<p>For security reasons, this API is best self-hosted and set up with ENV_VARS with the default connection string.</p>
250+
<p>If you want to use this with multiple Postgres instances, you can pass the connection string as a header but it must be encrypted.</p>
255251
<h2 id="self-hosting">Self Hosting</h2>
256252
<pre class="highlight"><code>https://github.com/supabase/pg-api
257253
</code></pre>

docs/source/index.html.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ curl -X GET http://localhost:1337/ \
4444
-H 'pg: {}' # see Postgres connection header below
4545
```
4646
```js
47-
const data = await fetch('https://pg-api.fly.dev', {
47+
const data = await fetch('http://localhost:1337', {
4848
method: 'GET',
4949
headers: {
5050
'Content-Type': 'application/json',
@@ -55,18 +55,13 @@ const data = await fetch('https://pg-api.fly.dev', {
5555
> Postgres connection header
5656
```json
5757
{
58-
"user": "postgres",
59-
"password": "postgres",
60-
"port": 5432,
61-
"host": "db.domain.com"
58+
"X-Connection-Encrypted": "ENCRYPTED_CONNECTION_STRING"
6259
}
6360
```
6461

65-
For security reasons, this API is best self-hosted. However, we provide an example API for you to test before installing. To use the API however, you have to send your PG connection via HTTPS headers.
62+
For security reasons, this API is best self-hosted and set up with ENV_VARS with the default connection string.
6663

67-
We DO NOT log these headers anywhere. But still, we HIGHLY recommend that you just self-host (we have tried to make this easy for you). Use the demo API at your own risk.
68-
69-
Database connection headers are not required for self-hosting. You can set ENV vars with your default connection details so that you don't pass connection details over a network.
64+
If you want to use this with multiple Postgres instances, you can pass the connection string as a header but it must be encrypted.
7065

7166

7267
## Self Hosting

0 commit comments

Comments
 (0)