This repository contains the codebase for generating the Krakend Playground demo website using Next.js. The generated content is to be run under the relative path /demo.
-
Install dependencies:
npm install
Create a .env file in the root of your project with the following content:
NEXT_PUBLIC_KRAKEND_LICENSE_TYPE=enterpriseThe NEXT_PUBLIC_KRAKEND_LICENSE_TYPE environment variable can be set to either "enterprise" or "open-source" depending on which playground you want to generate.
To start the development server, you can use one of the following commands:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun devOpen http://localhost:3000 in your browser to view the project.
To build the project, you can use the following command:
make build_eeThis will generate an out directory with the static HTML, CSS, and JavaScript files.
You can test the build with any static web server. For instance:
docker run -it -v "$PWD/out:/usr/share/nginx/html/demo" -p "8080:80" nginx
And then navigate to http://localhost:8080/demo/
You can add or edit use-case demo pages by modifying the .mdx files located in the pages/use-cases directory.
To create a new use-case page, you can use the following structure in a .mdx file:
import MdxLayout from '@/components/MdxLayout';
## About this demo
- One
- Two
- Three
export default function MDXPage({ children }) {
return <MdxLayout>{children}</MdxLayout>
}