【发布时间】:2019-04-02 23:38:30
【问题描述】:
我正在尝试在浏览器中使用 AWS StepFunctions API(角度,使用 aws javascript API)。 使用此代码:
import * as StepFunctions from "aws-sdk/clients/stepfunctions";
let sf = new StepFunctions({apiVersion: '2016-11-23'});
var request: GetExecutionHistoryInput = {
executionArn: executionArn,
maxResults: 1000,
reverseOrder: false
}
sf.getExecutionHistory(request).promise()
浏览器出现错误:
OPTIONS https://states.eu-west-1.amazonaws.com/ 404 (Not Found)
Failed to load https://states.eu-west-1.amazonaws.com/: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.
这是否意味着 AWS StepFunctions 还没有准备好在浏览器端使用? 如果是真的,它在 AWS 文档中的什么地方记录?
【问题讨论】:
标签: javascript amazon-web-services cors aws-step-functions aws-sdk-js