- Add Next.js frontend service (nextjs) with Dockerfile and source - Update docker-compose.yml: image names, Drupal 11.3.3, nextjs service - Add docker-compose.override.yml.disabled for dev hot-reload - Add install-headless-modules.sh for OAuth/JSON:API module setup - Add README.md with full setup and configuration guide - Update nginx/Dockerfile and nginx.conf.template for cms. subdomain - Update drupal/Dockerfile PHP-FPM build args - Gitignore **/.vscode/ to prevent IDE workspace files from being tracked
20 lines
554 B
TypeScript
20 lines
554 B
TypeScript
import { NextDrupal } from "next-drupal"
|
|
|
|
const baseUrl = process.env.NEXT_PUBLIC_DRUPAL_BASE_URL!
|
|
|
|
const auth =
|
|
process.env.DRUPAL_CLIENT_ID && process.env.DRUPAL_CLIENT_SECRET
|
|
? {
|
|
clientId: process.env.DRUPAL_CLIENT_ID,
|
|
clientSecret: process.env.DRUPAL_CLIENT_SECRET,
|
|
...(process.env.DRUPAL_OAUTH_SCOPE && {
|
|
scope: process.env.DRUPAL_OAUTH_SCOPE,
|
|
}),
|
|
}
|
|
: undefined
|
|
|
|
export const drupal = new NextDrupal(baseUrl, {
|
|
auth,
|
|
withAuth: !!auth,
|
|
debug: process.env.NODE_ENV === "development",
|
|
})
|