部署资源
以下资产/配置部署在AEM Forms发布服务器上。
-
使用OSGi configMgr在Apache Sling服务用户映射器服务中添加以下条目
DevelopingWithServiceUser.core:getformsresourceresolver=fd-service
部署示例react应用程序
- 下载示例react应用程序
- 在新文件夹中解压缩react应用程序的内容
- 导航到文件夹并运行以下命令
npm install
npm start
打开EmergencyContact.js文件,更改fetch方法中的URL以匹配您的环境。
const getWebForm=async()=>
{
setSpinner(true)
console.log("inside widgetURL function emergency contact");
// NOTE: replace the `aemforms.azure.com:4503` with your AEM FORM server
let res = await fetch("http://aemforms.azure.com:4503/bin/getwidgeturl",
{
method: "POST",
body: JSON.stringify({"icTemplate":"/content/forms/af/waiver/waiver/channels/print","waiver":formData})
})
要启用从REACT应用程序对AEM端点的POST调用,您需要在AdobeGranite跨源资源共享策略配置的允许源字段中指定相应的条目。
请参阅 使用AEM了解CORS 有关CORS配置选项的更多详细信息。
recommendation-more-help
8de24117-1378-413c-a581-01e660b7163e