diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-11 20:55:36 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-11 20:55:36 -0400 |
| commit | 5ff106e910544788bc916626ae7665cb26e5af30 (patch) | |
| tree | f03f98677293a9d892e2d21d1a9a80aeedab60a3 /ui/lib/apiServer.js | |
| parent | d33c8af14c4adc1c15ab048299e06f9f35ae4de6 (diff) | |
Provide a separate "initial setup" endpoint that creates a user.
Diffstat (limited to 'ui/lib/apiServer.js')
| -rw-r--r-- | ui/lib/apiServer.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ui/lib/apiServer.js b/ui/lib/apiServer.js index ccd6e66..46fcb53 100644 --- a/ui/lib/apiServer.js +++ b/ui/lib/apiServer.js @@ -3,12 +3,21 @@ import { channelsList, logins, messages } from '$lib/store'; export const apiServer = axios.create({ baseURL: '/api/', + validateStatus: (status) => status >= 200 && status < 500, }); export async function boot() { return apiServer.get('/boot'); } +export async function setup(username, password) { + const data = { + name: username, + password, + }; + return apiServer.post('/setup', data); +} + export async function logIn(username, password) { const data = { name: username, |
