mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-14 15:14:56 -04:00
16 lines
468 B
TypeScript
16 lines
468 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { defaultFetchConfig, expectResponseCode, getApiUrl } from '../utils'
|
|
import { Config } from './types'
|
|
|
|
export const getConfig = async (): Promise<Config> => {
|
|
const response = await fetch(getApiUrl() + 'config', {
|
|
...defaultFetchConfig
|
|
})
|
|
expectResponseCode(response)
|
|
return (await response.json()) as Promise<Config>
|
|
}
|