Skip to content

Commit a05e2a2

Browse files
committed
Better documentation, better hello world test page
1 parent 152fb33 commit a05e2a2

File tree

3 files changed

+30
-18
lines changed

3 files changed

+30
-18
lines changed

README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Google Assistant Demo
22
[![License: MPL 2.0](https://img.shields.io/badge/License-MPL%202.0-brightgreen.svg)](https://opensource.org/licenses/MPL-2.0)
33

4-
[Test this application for free on Heroku](https://heroku.com/deploy)
5-
64
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
75

86
This project is a small demo on how you can use data from Trafiklab.org, with the help of the Trafiklab PHP SDKs,
@@ -33,14 +31,20 @@ Read [the dialogflow docs](https://dialogflow.com/docs/agents/export-import-rest
3331

3432
### Webhook
3533
In order to deploy your webhook, you can use Heroku as a free and easy hosting service. This repository already contains
36-
the needed configuration. [A good tutorial on how you can deploy to Heroku can be found here](https://github.com/dwyl/learn-heroku),
37-
or you can read read [the official documentation](https://devcenter.heroku.com/articles/github-integration).
34+
the needed configuration. If you want to set up everything automatically, you can do so by clicking the deploy button on top of
35+
this readme, or by clicking [here](https://heroku.com/deploy).
36+
37+
If you want to set-up automatic deploys for a fork of this application, we have written
38+
[a tutorial on heruku](https://trafiklab.github.io/blog/heroku-free-hosting-with-automatic-deploy/),
39+
[another good tutorial on how you can deploy to Heroku can be found here](https://github.com/dwyl/learn-heroku),
40+
or you can read read [the official documentation](https://devcenter.heroku.com/articles/github-integration).
3841

3942
If you choose to host this project yourself, download the project to the location and run `composer install`. When configuring
4043
the web server, you need to use `/public` as the root directory of the project.
4144

4245
Ensure that you update your DialogFlow project with the correct fulfillment URL. This is the URL to which dialogflow will send
43-
its requests.
46+
its requests. You can change this by going to [the DialogFlow console](https://console.dialogflow.com), and going to the fulfillment page for your agent. The domain
47+
there should correspond with your own domain, or the one generated for your Heroku project.
4448

4549
## Forking, reporting issues and creating pull requests
4650

app.json

+19-12
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"description": "A demo application showing how to use the Trafiklab SDKs to build a Google Assistant application",
44
"keywords": [
55
"Trafiklab",
6+
"ResRobot",
67
"Google Assistant",
78
"DialogFlow"
89
],
@@ -11,28 +12,34 @@
1112
"logo": "https://avatars2.githubusercontent.com/u/6614637?s=200&v=4",
1213
"env": {
1314
"APP_DATAPROVIDER": {
14-
"description": "The data provider to use. Choose between 'SL' or 'RESROBOT' without the ''.",
15-
"required": true
15+
"description": "The data provider to use. Choose between 'SL' or 'RESROBOT' without the ''. SL offers detailled data for Stockholm, ResRobot offers data for entire Sweden. More information at https://trafiklab.se/trafiklab",
16+
"required": true,
17+
"value": "RESROBOT"
1618
},
1719
"RESROBOT_TIMETABLE_KEY": {
18-
"description": "Your API key for the Trafiklab ResRobot - Stolptidtabeller 2 API. You can leave this empty, but some features may not work.",
19-
"required": true
20+
"description": "Your API key for the Trafiklab ResRobot - Stolptidtabeller 2 API. You can leave this to the default value, but some features for ResRobot will not work. You can change this later. Learn how to create an API key at https://www.trafiklab.se/hur-gor-jag.",
21+
"required": true,
22+
"value": "change-me-to-use-this-api"
2023
},
2124
"RESROBOT_ROUTEPLANNING_KEY": {
22-
"description": "Your API key for the Trafiklab ResRobot Reseplanerare API. You can leave this empty, but some features may not work.",
23-
"required": true
25+
"description": "Your API key for the Trafiklab ResRobot Reseplanerare API. You can leave this empty, but some features for ResRobot will not work. You can change this later. Learn how to create an API key at https://www.trafiklab.se/hur-gor-jag.",
26+
"required": true,
27+
"value": "change-me-to-use-this-api"
2428
},
2529
"SL_TIMETABLE_KEY": {
26-
"description": "Your API key for the Trafiklab SL Realtidsinformation 4 API. You can leave this empty, but some features may not work.",
27-
"required": true
30+
"description": "Your API key for the Trafiklab SL Realtidsinformation 4 API. You can leave this empty, but some features for SL will not work. You can change this later. Learn how to create an API key at https://www.trafiklab.se/hur-gor-jag.",
31+
"required": true,
32+
"value": "change-me-to-use-this-api"
2833
},
2934
"SL_ROUTEPLANNING_KEY": {
30-
"description": "Your API key for the Trafiklab SL Reseplanerare 3.1 API. You can leave this empty, but some features may not work.",
31-
"required": true
35+
"description": "Your API key for the Trafiklab SL Reseplanerare 3.1 API. You can leave this empty, but some features for SL will not work. You can change this later. Learn how to create an API key at https://www.trafiklab.se/hur-gor-jag.",
36+
"required": true,
37+
"value": "change-me-to-use-this-api"
3238
},
3339
"SL_STATIONLOOKUP_KEY": {
34-
"description": "Your API key for the Trafiklab SL Platsuppslag API. You can leave this empty, but some features may not work.",
35-
"required": true
40+
"description": "Your API key for the Trafiklab SL Platsuppslag API. You can leave this empty, but some features for SL will not work. You can change this later. Learn how to create an API key at https://www.trafiklab.se/hur-gor-jag.",
41+
"required": true,
42+
"value": "change-me-to-use-this-api"
3643
},
3744
"LOG_CHANNEL": {
3845
"description": "This option is required to redirect log output to Heroku.",

routes/web.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@
3737
);
3838

3939
$router->get('/', function () {
40-
return 'Hello World! ' . env("APP_NAME") . ' is up and running!';
40+
return 'Hello World! ' . env("APP_NAME") . ' is up and running! Use "' . route('redirectIntent')
41+
. " as your fulfillment URL in DialogFlow";
4142
});

0 commit comments

Comments
 (0)