Toggle navigation
Toggle navigation
This project
Loading...
Sign in
은승우
/
LINEBOT
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
은승우
2019-12-02 13:52:13 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
19612d4c431c5adeaf5dbc045fc8d9d6327bfc00
19612d4c
1 parent
288487f0
Update app.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
app.js
app.js
View file @
19612d4
var
express
=
require
(
'express'
);
var
app
=
express
();
const
line
=
require
(
'@line/bot-sdk'
);
var
createServer
=
require
(
"auto-sni"
);
createServer
({
email
:
"sweun1@naver.com"
,
domains
:
[
"www.oss.chatbot.bu.to"
,
"oss.chatbot.bu.to"
],
agreeTos
:
true
},
app
);
// https
console
.
log
(
"1"
);
//papago api
var
express
=
require
(
"express"
);
var
app
=
express
();
const
line
=
require
(
'@line/bot-sdk'
);
var
request
=
require
(
'request'
);
const
lex
=
require
(
'greenlock-express'
).
create
({
version
:
'draft-11'
,
// 버전2
configDir
:
'/etc/letsencrypt'
,
// 또는 ~/letsencrypt/etc
approveDomains
:
(
opts
,
certs
,
cb
)
=>
{
if
(
certs
)
{
opts
.
domains
=
[
'oss.chatbot.bu.to'
,
'oss.chatbot.bu.to'
];
}
else
{
opts
.
email
=
'sweun1@naver.com'
;
opts
.
agreeTos
=
true
;
}
cb
(
null
,
{
options
:
opts
,
certs
});
},
renewWithin
:
81
*
24
*
60
*
60
*
1000
,
renewBy
:
80
*
24
*
60
*
60
*
1000
,
});
//papago api
https
.
createServer
(
lex
.
httpsOptions
,
lex
.
middleware
(
app
)).
listen
(
process
.
env
.
SSL_PORT
||
443
);
//번역 api_url
var
translate_api_url
=
'https://openapi.naver.com/v1/papago/n2mt'
;
...
...
@@ -26,7 +38,6 @@ const config = {
};
// create LINE SDK client
const
client
=
new
line
.
Client
(
config
);
// create Express app
...
...
Please
register
or
login
to post a comment