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
Ubuntu
2020-06-24 20:32:58 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cf8f4e83754f8b789835ed3c1c74904333517292
cf8f4e83
1 parent
38fb4e8f
update README.md
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
10 deletions
.package.swp
README.md
app.js
package-lock.json
.package.swp
0 → 100644
View file @
cf8f4e8
No preview for this file type
README.md
View file @
cf8f4e8
This diff is collapsed. Click to expand it.
app.js
View file @
cf8f4e8
...
...
@@ -6,9 +6,10 @@ 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
PORT
=
process
.
env
.
PORT
||
3000
;
const
sslport
=
23023
;
//const indexRoute = require("./routes/index");
app
.
use
(
bodyParser
.
urlencoded
({
extended
:
true
}));
...
...
@@ -82,6 +83,7 @@ app.post('/', async function(req,res){
extraaddressE
=
body
.
message
.
result
.
translatedText
;
}
});
setTimeout
(
function
(){
var
splitaddressE
=
addressE
.
split
(
", "
);
cityE
=
splitaddressE
[
4
];
...
...
@@ -100,11 +102,6 @@ app.post('/', async function(req,res){
}
});
app
.
listen
(
PORT
,
function
(){
console
.
log
(
'listen'
,
PORT
);
});
function
trans
(
message
,
totrans
){
request
.
post
(
{
...
...
@@ -129,14 +126,14 @@ 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/'
$
cert
:
fs
.
readFileSync
(
path
.
resolve
(
process
.
cwd
(),
'/etc/letsencrypt/live/
$
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
(
'[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않
습니다.'
);
console
.
log
(
error
);
}
...
...
package-lock.json
View file @
cf8f4e8
{
"requires"
:
true
,
"name"
:
"amazon_shopping_helper"
,
"version"
:
"1.0.0"
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"dependencies"
:
{
"accepts"
:
{
"version"
:
"1.3.7"
,
...
...
Please
register
or
login
to post a comment