🛂(app-desk) create fetchAPI
Create a fetch wrapper for the API calls, it will handle: - add correct basename on the api request - add Bearer automatically on the api request - logout automatically on 401 request
This commit is contained in:
@@ -1,14 +1,5 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
trailingSlash: true,
|
||||
async rewrites() {
|
||||
return [
|
||||
{
|
||||
source: '/api/:slug*/',
|
||||
destination: `${process.env.NEXT_PUBLIC_API_URL}:slug*/`, // Matched parameters can be used in the destination
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = nextConfig;
|
||||
|
||||
Reference in New Issue
Block a user