diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..b5bd761 --- /dev/null +++ b/.env.production @@ -0,0 +1,5 @@ +# This file is for Amplify to know which env vars to expose to Next.js +# The actual values come from Amplify Environment Variables +CONFLUENCE_API_URL=${CONFLUENCE_API_URL} +CONFLUENCE_TOKEN=${CONFLUENCE_TOKEN} +CONFLUENCE_PAGE_ID=${CONFLUENCE_PAGE_ID} \ No newline at end of file diff --git a/amplify.yml b/amplify.yml index 66cbe52..a1b8f2a 100644 --- a/amplify.yml +++ b/amplify.yml @@ -5,13 +5,19 @@ frontend: commands: - npm ci - npm run security:check + # Print env vars for debugging (without exposing values) + - env | grep CONFLUENCE | sed 's/=.*/=***/' build: commands: - npm run build artifacts: - baseDirectory: .next + baseDirectory: ./ files: - - '**/*' + - .next/**/* + - node_modules/**/* + - package.json + - next.config.js + - public/**/* cache: paths: - node_modules/**/* diff --git a/app/api/filaments/route.ts b/app/api/filaments/route.ts index 0aab978..5dc122c 100644 --- a/app/api/filaments/route.ts +++ b/app/api/filaments/route.ts @@ -1,6 +1,8 @@ import { NextResponse } from 'next/server'; import { fetchFromConfluence } from '../../../src/server/confluence'; +export const runtime = 'nodejs'; + export async function GET() { try { // Get environment variables from server-side only diff --git a/next.config.js b/next.config.js index 4b14fe3..a29a5db 100644 --- a/next.config.js +++ b/next.config.js @@ -1,7 +1,10 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, - // Remove output: 'standalone' for Amplify + // Ensure server-side features are enabled + experimental: { + serverActions: true, + }, } module.exports = nextConfig \ No newline at end of file