0.0.61 • Published 5 years ago
strapi-middleware-nextjs v0.0.61
Strapi NextJS Middleware
How it works
Creates additional routing details for the root url of your project.
Installing
Using npm
npm install --save strapi-middleware-nextjs next react react-domUsing yarn
yarn add strapi-middleware-nextjs next react react-domSetup
For Strapi stable versions, add a middleware.js file within your config folder
e.g
touch config/middleware.jsmodule.exports = {
  settings: {
    public: {
        defaultIndex: false
    }
  },
};and in your root directory create a pages folder
touch pages/index.jsPaste inside index.js
function HomePage() {
  return <div>Welcome to Next.js!</div>
}
export default HomePagestrapi build
strapi runStrapi Middleware NextJS Config
"enabled": boolean, // Enable or disable the middle ware based on config
"overripeApiRoutes": boolean, // Enable or disable the api route adjustment [default:"/api/{route}"), false:"/{route}" ]
"enableProd": boolean, // Enable NextJS middleware in production environment