feat: vue-frontend-gerüst mit statusseite
Vue 3 + Vite + TypeScript, Pinia und Vue Router, ESLint und Prettier. Die Startseite zeigt den Healthcheck des Backends im dunklen Design. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8e6ef05304
commit
99307acf7d
18 files changed
+3846
No files matched your search
@@ -0,0 +1,19 @@
|
||||
export class ApiError extends Error {
|
||||
constructor(
|
||||
public readonly status: number,
|
||||
message: string,
|
||||
) {
|
||||
super(message)
|
||||
}
|
||||
}
|
||||
|
||||
export async function apiGet<T>(path: string): Promise<T> {
|
||||
const response = await fetch(`/api${path}`, {
|
||||
credentials: 'same-origin',
|
||||
headers: { Accept: 'application/json' },
|
||||
})
|
||||
if (!response.ok) {
|
||||
throw new ApiError(response.status, `${response.status} ${response.statusText}`)
|
||||
}
|
||||
return (await response.json()) as T
|
||||
}
|
||||
Reference in new issue
Block a user