I want to configure the middleware of my craco.config.js, but I don’t know have, so I want tips. My actual file is:
const {CracoAliasPlugin} = require('react-app-alias')
module.exports = {
plugins: [
{
plugin: CracoAliasPlugin,
options: {}
}
],
}
I found that I need to do something:
devServer: (devServerConfig, { env, paths }) => {
devServerConfig = {
onBeforeSetupMiddleware: undefined,
onAfterSetupMiddleware: undefined,
setupMiddlewares: (middlewares, devServer) => {
// Define middlewares
return middlewares;
},
};
return devServerConfig;
},
But I don’t know how to use it and configure it, and I don’t want to implement any middlewares for now, just let the navigation without authentication. But, I’ll need them in the future, so, I want to know how to configure it and some tips on what is good to do here… also, if I just implement this the way is above it gives me error 404.