곽교린

Separate APIkeys from code to APIs.json

1 +{
2 + "youtubeAPI" : "",//insert your youtube API key.
3 + "papagoClientID" : "", //insert your papago client ID.
4 + "papagoClientSecret":"" //insert your papago client secret.
5 +}
...\ No newline at end of file ...\ No newline at end of file
...@@ -7,7 +7,8 @@ var qs = require('querystring'); ...@@ -7,7 +7,8 @@ var qs = require('querystring');
7 var path = require('path'); 7 var path = require('path');
8 const {google} = require("googleapis"); 8 const {google} = require("googleapis");
9 const service = google.youtube('v3'); 9 const service = google.youtube('v3');
10 -const apiKey = 'AIzaSyCjBrFKnBlGvxsfOD-qJP8nBkdEoqKRHu8'; //api키 10 +const apis = require('./APIs.json');
11 +const apiKey = apis.youtubeAPI; //api키
11 let videoNum = "TpPwI_Lo0YY"; //비디오 주소(예시) 12 let videoNum = "TpPwI_Lo0YY"; //비디오 주소(예시)
12 var videoLang = 'all'; //설정 언어 13 var videoLang = 'all'; //설정 언어
13 const serverIP = "http://localhost:3000" //서버의 주소 14 const serverIP = "http://localhost:3000" //서버의 주소
......
1 -AIzaSyCjBrFKnBlGvxsfOD-qJP8nBkdEoqKRHu8
...\ No newline at end of file ...\ No newline at end of file
1 - 1 +const apis = require('./APIs.json');
2 -var client_id = '6hpmInU0TCrQIiiJwgJX'; 2 +var client_id = apis.papagoClientID;
3 -var client_secret = 'jpYZbkj0_g'; 3 +var client_secret = apis.papagoClientSecret;
4 // var query = "언어를 감지할 문장을 입력하세요."; 4 // var query = "언어를 감지할 문장을 입력하세요.";
5 // app.get('/detectLangs', function (req, res) { 5 // app.get('/detectLangs', function (req, res) {
6 // var api_url = 'https://openapi.naver.com/v1/papago/detectLangs'; 6 // var api_url = 'https://openapi.naver.com/v1/papago/detectLangs';
......