pickstack

Nuxt + Axios

HTTP client with a preconfigured base URL. This page shows exactly what pickstack adds to a Nuxt 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 nuxt --modules axios --yes
Customize in the configurator

Packages it adds

PackageVersionType
axios^1.21.1runtime

New files

.env.example
NUXT_PUBLIC_API_URL=http://localhost:3000
app/plugins/api.ts
import axios from "axios";

export default defineNuxtPlugin(() => {
  const config = useRuntimeConfig();
  const api = axios.create({
    baseURL: config.public.apiUrl,
    timeout: 10_000,
  });

  return { provide: { api } };
});

Changes to existing files

app/pages/about.vue (changed)
 <template>   <section class="page">     <h1 class="title">About</h1>+    <p class="text">Built with Nuxt 4, Vue 3, TypeScript, Axios.</p>−    <p class="text">Built with Nuxt 4, Vue 3, TypeScript.</p>   </section> </template>  
nuxt.config.ts (changed)
⋯ 2 unchanged lines   compatibilityDate: "2025-07-15",   devtools: { enabled: true },   css: ["~/assets/css/main.css"],+  runtimeConfig: { public: { apiUrl: "http://localhost:3000" } }, });  

Project files

Related templates