카카오 챗봇 기본 API 작성
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
//express 모듈 로드 var express = require( 'express' ); //http 모듈 불러온 후 http 변수에 저장 var http = require( 'http' ); //express 객체 app 변수에 저장 var app = express(); //http://서버주소/keyboard /* 라우팅 처리 */ app.get( '/keyboard' , function (req,res){ (req,res){ //전달할 데이터 var data = { 'type' : 'buttons' , 'buttons' : [ '과일' , '채소' , '정보' ] }; res.json(data); }); //9090포트로 서버 실행 http.createServer(app).listen( 9090 , function (){ console .log( '서버 실행 중..' ); }); http://colorscripter.com/info#e " target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
from http://not-null.tistory.com/9 by ccl(S) rewrite - 2020-03-11 05:54:05
댓글
댓글 쓰기