问题描述
我正在试验自己的Google Home,并且阅读了很多有关Google上的操作的信息,并且能够将其部署到Google Cloud Services,但是Google Home如何知道我的应用程序在Heroku上的位置?
I'm experimenting with my Google Home and I read a lot about actions on google and was able to deploy it to Google Cloud Services, but how does the Google Home know where my application is if it's on Heroku?
它与 creds.data
和 Google上的Actions-nodejs有关系吗SDK
?
推荐答案
以下是在Google主页上部署heroku应用的步骤。
Here is a steps to deploy an heroku app with google home.
让我们以谷歌提供的示例为例。
Let us take an example provided by google.
-
首先下载git in您的系统 git-scm.com/download/win
从 heroku.com 下载Heroku CLI
Download Heroku CLI from heroku.com
从此处 nodejs.org/en /
在计算机中打开 Git Bash ,找到要启动项目的文件夹。
Open Git Bash in your computer, locate a folder where you want to start your project.
克隆git Google提供的专案范例( git clone ),这是git bash在您的计算机中克隆项目的命令,只需将命令复制并粘贴以反逗号分隔,然后按Enter,您将找到一个名称为( apiai-facts -about-google-nodejs )。
Clone git project Example provide by Google (" git clone https://github.com/actions-on-google/apiai-facts-about-google-nodejs "), this is a command for git bash to clone project in your computer, just copy and paste the command separated in inverted comma and press enter, you will find a new folder with name (apiai-facts-about-google-nodejs) .
使用这些命令来完成操作(所有粗体字下面的命令 strong>)
Use these Command to get the things done(BELOW BOLD TEXT ARE ALL COMMANDS)
cd apiai-facts-about-google-nodejs (GIT Bash命令)
cd apiai-facts-about-google-nodejs (Command for GIT Bash)
npm install (GIT Bash命令)
npm install (Command for GIT Bash)
Heroku登录(在命令提示符下)并写入heroku凭据
Heroku Login (In Command Prompt) and write heroku credentials
heroku创建APP_NAME (用于GIT Bash的命令)
heroku create APP_NAME (Command for GIT Bash)
git add。(GIT Bash命令)fullestop很重要,它告诉您应用程序处于当前工作状态
git add . (Command for GIT Bash) fullestop is important which tells that you app is in current working directory.
git commit -am Firstcommit (GIT Bash命令)
git commit -am "Firstcommit" (Command for GIT Bash)
git push heroku master (GIT Bash命令)
git push heroku master (Command for GIT Bash)
******************** END OF NODE.JS PART *********************
********************END OF NODE.JS PART*********************
-
打开API.AI登录并创建新代理。
Open API.AI login and Create New Agent.
以MyAction命名。
With named MyAction.
将zip还原到MyAction项目中:(当克隆GIT App时,创建了一个文件夹要点5 ,在上面提到,在文件夹中有一个ZIP文件,基本上用于API.AI)
Restore the zip into the MyAction project: (When You clone GIT App, A folder was created On POINT NO 5 ,mention above ,inside a folder there is a ZIP file, it is basically for API.AI)
点击
单击导出和导入选项卡。
Click on the Export and Import tab.
单击从Zip还原,然后选择API.AI项目zip文件(位于示例文件夹中,名称为FactsAboutGoogle.ZIP)。
Click Restore from Zip and select the API.AI project zip file (Located in your sample folder with name FactsAboutGoogle.ZIP ).
在文本框中键入还原,然后单击还原。
Type RESTORE in the text box and click Restore.
启用实现:
单击实现,然后将已启用滑块向右滑动。
Click Fulfillment and slide the Enabled slider to the right.
在URL字段中,输入要实现的端点URL。 URL是您的Node.js应用程序,在heroku.com上登录,选择您创建的名称为 10号点的应用程序。
In the URL field, enter the endpoint URL for fulfillment. The URL is Your Node.js Application , Login on heroku.com select the app you create with name in Point No 10 .
在右上角,您将看到一个链接,打开应用,点击该链接,将URL复制并粘贴到您的API中。AI实现和启用域。
On the top right hand ,You will see a link Open App click on it copy the URL and Paste into your API.AI fulfillment and ENABLE DOMAINS.
现在您可以在API.AI上测试您的应用程序,它开始与Heroku进行通信,但仍无法与Google Home进行通信。为此,请执行以下步骤。
Now you can test you app on API.AI it start communication with Heroku but still not with Google Home. For this follow the below steps.
单击集成。
在GOOGLE上启用操作
Enable ACTION ON GOOGLE
名称您从Google主页呼叫的代理。
Name The Agent you call from your google home.
他要求提供Google Project ID(为此您必须在Google云上创建一个项目)。
he is asking for Google Project ID (for this you will have to create a project on google cloud).
转到 console.developers.google.com
创建应用
单击启用API
搜索 Google Actions API
点击 Google Actions API
单击启用
单击目录列表
填写表格。
请参阅并在与Google集成的其余部分上实现ng已经完成。
See the Youtube video and implement on Integration with Google rest of the thing already done.
现在您可以使用Google Home了。
Now you can able to play with Google Home.
这篇关于如何在Heroku上部署Google Actions?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!