강수인

papago api 를 위한 url과 key 등록

Showing 1 changed file with 14 additions and 0 deletions
1 const line = require('@line/bot-sdk'); 1 const line = require('@line/bot-sdk');
2 const express = require('express'); 2 const express = require('express');
3 +//papago api
4 +var request = require('request');
5 +
6 +//번역 api_url
7 +var translate_api_url = 'https://openapi.naver.com/v1/papago/n2mt';
8 +
9 +//언어감지 api_url
10 +var languagedetect_api_url = 'https://openapi.naver.com/v1/papago/detectLangs'
11 +
12 +// Naver Auth Key
13 +//새로 발급받은 naver papago api id, pw 입력
14 +var client_id = 'xZMx34y7uru1v8lywZ2d';
15 +var client_secret = 'p6L7M7WsH9';
3 16
4 // create LINE SDK config from env variables 17 // create LINE SDK config from env variables
5 const config = { 18 const config = {
...@@ -33,6 +46,7 @@ function handleEvent(event) { ...@@ -33,6 +46,7 @@ function handleEvent(event) {
33 return Promise.resolve(null); 46 return Promise.resolve(null);
34 } 47 }
35 48
49 +
36 // create a echoing text message 50 // create a echoing text message
37 const echo = { type: 'text', text: event.message.text }; 51 const echo = { type: 'text', text: event.message.text };
38 52
......