Toggle navigation
Toggle navigation
This project
Loading...
Sign in
최현준
/
도와줘요 채팅맨
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
1
Network
Create a new issue
Commits
Issue Boards
Authored by
최현준
2020-06-14 22:38:19 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
51683ceca7db7ca1b002797776e98060d59ad360
51683cec
1 parent
33d54b37
도메인 연결
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
2 deletions
app.js
app.js
View file @
51683ce
...
...
@@ -8,6 +8,11 @@ const PAPAGO_ID = 'tA41WEd_nbzy0nZcUQks'
const
PAPAGO_SECRET
=
'6DHwov9gg2'
const
WEATHER_TARGET_URL
=
'http://apis.data.go.kr/1360000/VilageFcstInfoService/getVilageFcst'
;
const
weather_key
=
'CuIdcpULvcissE3Jk7AyAXok4bR4j6xyNkhfmWxOI9%2BxCs%2FkI%2F4v4j4rz3DDsQZVeuJTrWQhzQ3CV4JkeykMSw%3D%3D'
;
const
fs
=
require
(
'fs'
);
const
path
=
require
(
'path'
);
const
HTTPS
=
require
(
'https'
);
const
domain
=
"www.theia17.tk"
const
sslport
=
23023
;
const
bodyParser
=
require
(
'body-parser'
);
var
app
=
express
();
var
async
=
require
(
'async'
);
...
...
@@ -382,6 +387,21 @@ function weather_get (url, User_Location)
});
}
app
.
listen
(
3000
,
function
()
{
console
.
log
(
'Linebot listening on port 3000!'
);
try
{
const
option
=
{
ca
:
fs
.
readFileSync
(
'/etc/letsencrypt/live/'
+
domain
+
'/fullchain.pem'
),
key
:
fs
.
readFileSync
(
path
.
resolve
(
process
.
cwd
(),
'/etc/letsencrypt/live/'
+
domain
+
'/privkey.pem'
),
'utf8'
).
toString
(),
cert
:
fs
.
readFileSync
(
path
.
resolve
(
process
.
cwd
(),
'/etc/letsencrypt/live/'
+
domain
+
'/cert.pem'
),
'utf8'
).
toString
(),
};
HTTPS
.
createServer
(
option
,
app
).
listen
(
sslport
,
()
=>
{
console
.
log
(
`[HTTPS] Server is started on port
${
sslport
}
`
);
});
}
catch
(
error
)
{
console
.
log
(
'[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.'
);
console
.
log
(
error
);
}
app
.
listen
(
23023
,
function
()
{
console
.
log
(
'Linebot listening on port 23023!'
);
});
\ No newline at end of file
...
...
Please
register
or
login
to post a comment