For instruction, please visit:
Open src/services/setupInterceptors.js
and modify config.headers
for appropriate back-end (found in the tutorial).
instance.interceptors.request.use(
(config) => {
const token = TokenService.getLocalAccessToken();
if (token) {
// config.headers["Authorization"] = 'Bearer ' + token; // for Spring Boot back-end
config.headers["x-access-token"] = token; // for Node.js Express back-end
}
return config;
},
(error) => {
return Promise.reject(error);
}
);
npm install
npm run serve
More Practice:
Fullstack with Spring Boot Back-end:
Spring Boot + Vue.js: Authentication with JWT & Spring Security Example
Fullstack with Node.js Express Back-end:
Node.js Express + Vue.js: JWT Authentication & Authorization example
Fullstack CRUD:
Integration (run back-end & front-end on same server/port)