App Builder — 第一個應用程式相關頁面
自動翻譯
使用「語言選取器」檢視此頁面的英文版。
翻譯是否有幫助?
建立對象:
.env是特殊檔案,不屬於範例模組,但對於Adobe Developer App Builder應用程式中的使用很重要。 此檔案包含密碼和其他資訊。 避免將此檔案提交至任何程式碼存放庫。
.env檔案。# Specify your secrets here
# The .env file must not be committed to source control
## Adobe I/O Runtime credentials
AIO_runtime_auth=abcd1234-aaa-bbb-ccc-12345:Abcdd12345asdfadsfadsfee2323232323232
AIO_runtime_namespace=12345-someworkspace-stage
AIO_runtime_apihost=https://adobeioruntime.net
## Adobe I/O Console service account credentials (JWT) Api Key
SERVICE_API_KEY=
# You can include some commerce OAUTH credentials too, our sample module will use this
#COMMERCE_BASE_URL=https://somecommercewebsite.com/
#COMMERCE_CONSUMER_KEY=abcebdme5bvafnemk0mdeeiyfq123
#COMMERCE_CONSUMER_SECRET=ffff86sqws3pss5hhuofiqgq4t04rrr11
#COMMERCE_ACCESS_TOKEN=gdddfccronj098r4m04zyq773s5o64
#COMMERCE_ACCESS_TOKEN_SECRET=ggg7nb19jhr5gi9jzfan9ggzipe8yrus
您可以在檔案actions/commerce.index.js中看到這些靜態值正用於範例模組。
const oauth = getCommerceOauthClient(
{
url: params.COMMERCE_BASE_URL,
consumerKey: params.COMMERCE_CONSUMER_KEY,
consumerSecret: params.COMMERCE_CONSUMER_SECRET,
accessToken: params.COMMERCE_ACCESS_TOKEN,
accessTokenSecret: params.COMMERCE_ACCESS_TOKEN_SECRET
},
logger
)