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 --yesCustomize in the configurator
Packages it adds
| Package | Version | Type |
|---|---|---|
axios | ^1.21.1 | runtime |
New files
NUXT_PUBLIC_API_URL=http://localhost:3000
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
<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>
⋯ 2 unchanged lines compatibilityDate: "2025-07-15", devtools: { enabled: true }, css: ["~/assets/css/main.css"],+ runtimeConfig: { public: { apiUrl: "http://localhost:3000" } }, });
Project files
.env.example.gitignoreREADME.mdapp/app.vueapp/assets/css/main.cssapp/components/CounterCard.vueapp/pages/about.vueapp/pages/index.vueapp/plugins/api.tsnuxt.config.tspackage.jsonpublic/robots.txttsconfig.json