For more detail, please visit:
React Hooks + Redux: JWT Authentication & Authorization example
This project was bootstrapped with Create React App.
.env
PORT=8081
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);
}
);
In the project directory, you can run:
npm install
# or
yarn install
or
npm start
# or
yarn start
Open http://localhost:8081 to view it in the browser.
The page will reload if you make edits.
Fullstack (JWT Authentication & Authorization example):
Fullstack CRUD with Node.js Express:
Fullstack CRUD with Spring Boot:
Fullstack CRUD with Django:
Integration (run back-end & front-end on same server/port)
Serverless: