Add justfile and essential recipes. Add unit tests. Add linter and fix linter errors.
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
import { action, query } from "@solidjs/router";
|
||||
|
||||
const API_BASE_URL = process.env.API_BASE_URL ?? "http://localhost:5013";
|
||||
|
||||
const buildUrl = (path: string) =>
|
||||
`${API_BASE_URL.replace(/\/+$/, "")}/${path.replace(/^\/+/, "")}`;
|
||||
import { buildApiUrl } from "./url";
|
||||
|
||||
async function fetchApi<T>(path: string, init?: RequestInit): Promise<T> {
|
||||
const response = await fetch(buildUrl(path), {
|
||||
const response = await fetch(buildApiUrl(path), {
|
||||
...init,
|
||||
headers: {
|
||||
"content-type": "application/json",
|
||||
|
||||
Reference in New Issue
Block a user