React + Axios
HTTP client with a preconfigured base URL. This page shows exactly what pickstack adds to a React 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 react --modules axios --yesCustomize in the configurator
Packages it adds
| Package | Version | Type |
|---|---|---|
axios | ^1.21.1 | runtime |
New files
VITE_API_URL=http://localhost:3000
import axios from "axios";
export const api = axios.create({
baseURL: import.meta.env.VITE_API_URL ?? "http://localhost:3000",
timeout: 10_000,
});
Project files
.env.example.gitignoreREADME.mdindex.htmlpackage.jsonsrc/App.tsxsrc/api/client.tssrc/components/Counter.tsxsrc/index.csssrc/main.tsxtsconfig.jsonvite.config.ts