首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Alexa ask-cli如何添加自定义https服务器

Alexa ask-cli如何添加自定义https服务器
EN

Stack Overflow用户
提问于 2018-04-26 18:01:26
回答 2查看 754关注 0票数 1

当我尝试使用https服务器部署我的技能时,我无法使用alexa-cli工具(https://www.npmjs.com/package/ask-cli)部署alexa技能

作为一个错误,我得到了:

代码语言:javascript
复制
  ◞  Creating new skill...Call create-skill error.
Error code: 400
{
  "message": "Skill manifest is not valid.",
  "violations": [
    {
      "message": "No default regionalized endpoint is defined."
    }
  ]
}

我使用了一个来自:https://github.com/alexa/skill-sample-nodejs-hello-world/blob/master/skill.json的示例skill.json

一个问题是如何添加自定义uri端点。我不想在AWS lambda函数中托管我的技能。

我尝试遵循文档:https://developer.amazon.com/de/docs/smapi/ask-cli-command-reference.html,但我不知道我做错了什么……

有人能看看我的json和alexa-cli文档吗?为什么我收到这么奇怪的消息?

代码语言:javascript
复制
"No default regionalized endpoint is defined."

代码语言:javascript
复制
{
    "manifest": {
        "publishingInformation": {
            "locales": {
                "en-US": {
                    "summary": "Sample Short Description",
                    "examplePhrases": [
                        "Alexa open hello world",
                        "Alexa tell hello world my name is bill",
                        "Alexa tell hello world I want to play"
                    ],
                    "name": "trivia",
                    "description": "Sample Full Description"
                }
            },
            "isAvailableWorldwide": true,
            "testingInstructions": "Sample Testing Instructions.",
            "category": "KNOWLEDGE_AND_TRIVIA",
            "distributionCountries": []
        },
        "apis": {
            "custom": {
                "endpoint": {
                    "sourceDir": "./lambda/custom",
                    "uri": "https://customapi.sampleskill.com",
                    "  sslCertificateType": "Wildcard"
                },
                "regions": {
                    "EU": {
                        "endpoint": {
                            "uri": "https://customapi.sampleskill.com",
                            "sslCertificateType": "Trusted"
                        }
                    }
                }
            }
        },
        "manifestVersion": "1.0"
    }
}
EN

回答 2

Stack Overflow用户

发布于 2018-04-27 06:49:42

对于将来遇到这个问题的人来说,Ok ;)重要的是,在您的技能根目录中有该文件:

代码语言:javascript
复制
.ask/config

它应该看起来像这样:

代码语言:javascript
复制
{
  "deploy_settings": {
    "default": {
      "skill_id": "put here your skill id or leave it blank",
      "was_cloned": false,
      "merge": {
        "manifest": {
          "apis": {
            "custom": {
              "endpoint": {
                "uri": "https://yourhttps.de",
                "sslCertificateType": "Wildcard"
              }
            }
          }
        }
      }
    }
  }
}

之后,您可以使用ask-cli并将https服务器作为端点:)

票数 2
EN

Stack Overflow用户

发布于 2018-04-26 18:36:04

试试这个:

代码语言:javascript
复制
    "apis": {
        "custom": {
            "endpoint": {
                "uri": "https://customapi.sampleskill.com",
                "sslCertificateType": "Wildcard"
            },
            "regions": {
                "EU": {
                    "endpoint": {
                        "uri": "https://customapi.sampleskill.com",
                        "sslCertificateType": "Trusted"
                    }
                }
            }
        }
    }

在默认配置中,您设置了sourceDir,这对于AWS Lambda之外的端点没有太大意义。其次,您的配置包含sslCertificateType周围的空格,这也可能导致问题。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50040138

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档