Ubuntu

update README.md

No preview for this file type
This diff is collapsed. Click to expand it.
......@@ -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);
}
......
{
"requires": true,
"name": "amazon_shopping_helper",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"accepts": {
"version": "1.3.7",
......