Toggle navigation
Toggle navigation
This project
Loading...
Sign in
장주현
/
Amazon_Shopping_Helper
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
장주현
2020-06-25 15:23:44 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c2c157a4788a070ecb790478842dd9936fe26e50
c2c157a4
1 parent
dab73e1e
github 배포용으로 수정
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
19 deletions
app.js
app.js
View file @
c2c157a
...
...
@@ -4,11 +4,11 @@ const fs = require('fs');
const
bodyParser
=
require
(
'body-parser'
);
const
app
=
express
();
const
PAPAGO_URL
=
'https://openapi.naver.com/v1/papago/n2mt'
const
PAPAGO_ID
=
'
cIZBOTfISMHEyygh_NHp
'
;
const
PAPAGO_SECRET
=
'
8D32UNGgYp
'
;
const
path
=
require
(
'path'
);
const
HTTPS
=
require
(
'https'
);
const
domain
=
"www.chatosscjh.tk"
const
PAPAGO_ID
=
'
Client ID
'
;
const
PAPAGO_SECRET
=
'
Client Secret
'
;
//
const path = require('path');
//
const HTTPS = require('https');
//
const domain = "www.chatosscjh.tk"
const
sslport
=
23023
;
//const indexRoute = require("./routes/index");
...
...
@@ -218,17 +218,21 @@ function trans(message, totrans){
});
};
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
(
sslport
,
function
(){
console
.
log
(
'listen'
,
sslport
);
});
//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);
// }
...
...
Please
register
or
login
to post a comment