I successfuly deployed site using Azure static-Web-App using "next export" which create "out" folder for static pages. But i am using STRIPE payment intent in my next.js API folder. and i am unable to access api folder as site is deployed as static. while Azure claim that they handled Deploy static-rendered Next.js in static web app. i also followed Deploy hybrid Next.js but dont have any luck. This this https://stackoverflow.com/a/75107663 also discuss the same but i am unable to deploy the site as SSR.
Pakage.json:
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint" },
Azure.yml file:
app_location: "/" # App source code path
api_location: "api" # Api source code path - optional
output_location: "" # Built app content directory - optional
I also use
next build && rm -rf ./.next/cache
for build to reduce size, but doesnt workout for me.
if i change pakage.json build command to "next build && next export" it worked as static site but API not accessable. what to change in this so i can access backend API folder to achieve payment