Create a new Next.js app using one of the following starter templates, where everything is set up for you automatically.
Basic starter
npx create-next-app frontend.example.ch -e https://github.com/NETNODEAG/nodehive-nextjs-starter/tree/main
cd frontend.example.ch
cp .env.example .env
open localhost:3000
npm run dev
Here are the streamlined steps to connect your frontend with Drupal:
- Navigate to your frontend project directory:
cd frontend.example.ch
- Create a local environment file from the example:
cp .env.example .env.local
- Open
.env.local
and populate the necessary environment variables required for Drupal deployments. Refer to your Drupal deployment documentation for specifics. Save the changes when done.
cd frontend.example.ch
nvm use
npm install
npm run dev
To change the default landing page of your application, follow the steps outlined below. This process involves modifying the STARTPAGE_SLUG
value to reflect the Node ID of the page you wish to make your new start page.
- Locate File: Go to your project's
src/app/
directory and openpage.tsx
. - Change Value: Find the
STARTPAGE_SLUG
constant and replace its current value with your desired Node ID as a string (e.g., "12345"). - Save and Test: Save the file, then run the application to confirm that the new start page matches the specified Node ID.
The most straightforward method to deploy your NodeHive Next.js application is to use the Vercel Platform, which is developed by the creators of Next.js.
To initiate a new project quickly, simply click the "Deploy" button ⚡️