pickstack

Svelte + Axios

HTTP client with a preconfigured base URL. This page shows exactly what pickstack adds to a Svelte project for Axios: the packages, the new files and the changes to existing ones. Every combination is installed, built, linted and tested in CI.

$ npm create pickstack@latest my-app -- --framework svelte --modules axios --yes
Customize in the configurator

Packages it adds

PackageVersionType
axios^1.21.1runtime

New files

.env.example
VITE_API_URL=http://localhost:3000
src/api/client.ts
import axios from "axios";

export const api = axios.create({
  baseURL: import.meta.env.VITE_API_URL ?? "http://localhost:3000",
  timeout: 10_000,
});

Project files

Related templates