简体   繁体   English

Alexa Ask-CLI如何添加自定义https服务器

[英]Alexa ask-cli how to add a custom https server

I'm not able deploy alexa skill using alexa-cli tool ( https://www.npmjs.com/package/ask-cli ) when I try to deploy my skill with a https server 当我尝试通过https服务器部署我的技能时,我无法使用Alexa-cli工具( https://www.npmjs.com/package/ask-cli )部署Alexa技能

As an error I get: 作为错误,我得到:

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

Im using an example skill.json from: https://github.com/alexa/skill-sample-nodejs-hello-world/blob/master/skill.json 我正在使用示例技能: https//github.com/alexa/skill-sample-nodejs-hello-world/blob/master/skill.json

A problem is how to add custom uri endpoint. 问题是如何添加自定义uri端点。 I dont want to host my skill in AWS lambda function. 我不想在AWS lambda函数中发挥我的技能。

I tried to follow documentation: https://developer.amazon.com/de/docs/smapi/ask-cli-command-reference.html but I dont know what Im doing wrong... 我试图遵循文档: https : //developer.amazon.com/de/docs/smapi/ask-cli-command-reference.html但我不知道我在做什么错...

Could sombody please take a look at my json and alexa-cli documentation? 可以请大家看看我的json和alexa-cli文档吗? Why Im getting a such weird message? 为什么我收到这样奇怪的消息?

"No default regionalized endpoint is defined."

?

{
    "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"
    }
}

Ok for those who faced that problem in the future ;) Important is that in your skill root directory you have that file: 好的,对于那些将来遇到这个问题的人来说很重要;)重要的是,在您的技能根目录中,您拥有该文件:

.ask/config

It should look like: 它应该看起来像:

{
  "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"
              }
            }
          }
        }
      }
    }
  }
}

after that you can use ask-cli with the https server as an endpoint :) 之后,您可以将Ask-cli与https服务器一起用作终结点:)

Try this: 尝试这个:

    "apis": {
        "custom": {
            "endpoint": {
                "uri": "https://customapi.sampleskill.com",
                "sslCertificateType": "Wildcard"
            },
            "regions": {
                "EU": {
                    "endpoint": {
                        "uri": "https://customapi.sampleskill.com",
                        "sslCertificateType": "Trusted"
                    }
                }
            }
        }
    }

In the default config you had set sourceDir which doesn't make much sense for endpoints outside AWS Lambda. 在默认配置中,您设置了sourceDir ,对于AWS Lambda之外的终端节点没有多大意义。 Second your config contained whitespace around sslCertificateType , which also might cause the problem. 其次,您的配置在sslCertificateType周围包含空格,这也可能导致问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用ask-sdk-core自定义技能的Alexa sdk v2失败,原因:会话终止,原因:ERROR - Alexa sdk v2 using ask-sdk-core custom skill fails with : Session ended with reason: ERROR 如何在Alexa中以编程方式清除自定义插槽值? - How to clear custom slot value programmatically in Alexa? 如何将自定义代码添加到 Angular cli 生成的 Service Worker - How to add custom code to Angular cli generated service worker 当用户在this.emit(“:ask”,speech)之后什么都没输入到Alexa时,我该如何解决? - How can I account for when the user inputs nothing to Alexa after this.emit(“:ask”, speech)? 是否可以在Lambda ASK代码中向自定义插槽类型添加值? - Is it possible to add values to a custom slot type in Lambda ASK code? Alexa Skills Kit:如何使用JS将图像添加到标准卡中 - Alexa Skills Kit: How to add an image to a standard card using JS 如何将HTTPS表单提交到HTTPS服务器 - How to submit HTTPS forms to a HTTPS server Alexa Trivia Quiz:尝试在新游戏消息中添加自定义音频文件 - Alexa Trivia Quiz: trying to add custom audio file in the new game message Alexa提出问题并从外部API获得响应 - Alexa ask a question and get response from external API Amazon Alexa自定义插槽备忘录 - Amazon Alexa custom slot memo
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM