This is the NextJS-based sample application which runs with Luigi framework.
Due to the nature of NextJS's routing strategy, it is not possible to use useHashRouting: false
in the Luigi Configuration. If you want to use path based routing, Luigi Core's index.html should be served separately.
NOTE: Due to NextJS's server side nature, injecting Luigi Client in your pages is not straightforward, since Luigi Client relies on the window object only available at the client side. To resolve that, simply include the
luigi-client.js
file as the source of an HTML script as shown in thehome.js
file. This will allow you to use Luigi Client as part of the window object of that micro frontend, for example:window['LuigiClient']
First, install dependencies
npm install
Second, build the NextJS app:
npm run build
Next, run the server:
# for production mode
npm run start
# or for development mode
npm run dev
Open http://localhost:3000 with your browser to see the result.
The Next.js project bootstrapped with create-next-app
.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.