-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathindex.js
47 lines (43 loc) · 1.2 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
"use strict";
/*
** Import Packages
*/
const server = require("express")();
const bot_express = require("bot-express");
/*
** Middleware Configuration
*/
server.listen(process.env.PORT || 5000, () => {
console.log("server is running...");
});
/*
** Mount bot-express
*/
server.use("/webhook", bot_express({
language: "ja",
nlu: {
type: "dialogflow",
options: {
project_id: process.env.GOOGLE_PROJECT_ID,
client_email: process.env.GOOGLE_CLIENT_EMAIL,
private_key: process.env.GOOGLE_PRIVATE_KEY,
language: "ja"
}
},
parser: [{
type: "dialogflow",
options: {
project_id: process.env.GOOGLE_PROJECT_ID,
client_email: process.env.GOOGLE_CLIENT_EMAIL,
private_key: process.env.GOOGLE_PRIVATE_KEY,
language: "ja"
}
}],
line_channel_secret: process.env.LINE_CHANNEL_SECRET,
line_access_token: process.env.LINE_ACCESS_TOKEN,
default_skill: process.env.DEFAULT_SKILL,
google_project_id: process.env.GOOGLE_PROJECT_ID,
google_api_key: process.env.GOOGLE_API_KEY,
auto_translation: process.env.AUTO_TRANSLATION
}));
module.exports = server;