summaryrefslogtreecommitdiff
path: root/examples/server/public/index.html
diff options
context:
space:
mode:
authorShadovvBeast <ShadovvBeast@gmail.com>2023-12-15 13:49:01 +0200
committerGitHub <noreply@github.com>2023-12-15 13:49:01 +0200
commit88ae8952b65cbf32eb1f5703681ea592e510e570 (patch)
treed3624a445dbd8857c4f3bc62d512c44dcab8a693 /examples/server/public/index.html
parentee4725a686643669a8587142fa068cbf29de3ce2 (diff)
server : add optional API Key Authentication example (#4441)
* Add API key authentication for enhanced server-client security * server : to snake_case --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
Diffstat (limited to 'examples/server/public/index.html')
-rw-r--r--examples/server/public/index.html7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/server/public/index.html b/examples/server/public/index.html
index 451fd4a3..07d779d2 100644
--- a/examples/server/public/index.html
+++ b/examples/server/public/index.html
@@ -235,7 +235,8 @@
grammar: '',
n_probs: 0, // no completion_probabilities,
image_data: [],
- cache_prompt: true
+ cache_prompt: true,
+ api_key: ''
})
/* START: Support for storing prompt templates and parameters in browsers LocalStorage */
@@ -790,6 +791,10 @@
<fieldset>
${IntField({ label: "Show Probabilities", max: 10, min: 0, name: "n_probs", value: params.value.n_probs })}
</fieldset>
+ <fieldset>
+ <label for="api_key">API Key</label>
+ <input type="text" name="api_key" value="${params.value.api_key}" placeholder="Enter API key" oninput=${updateParams} />
+ </fieldset>
</details>
</form>
`