inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

172만명의 커뮤니티!! 함께 토론해봐요.

graphql 서버 언제 고쳐질까요.. ㅠ

해결됨

[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스

공부하고 싶어요..ㅠ

  • react
  • node.js
  • seo
  • graphql
  • next.js
ten 댓글 1 좋아요 0 조회수 177

API 그래프큐엘 서버 터진거 고쳐주세요.

해결됨

[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스

지금 터저서 테스트 안되요 고쳐주세요.

  • react
  • node.js
  • seo
  • graphql
  • next.js
hojin kim (hojin) 댓글 1 좋아요 0 조회수 190

세션 8장 마무리 후 product 에서 상품 이미지 깨짐 현상

미해결

코드로 배우는 React 19 with 스프링부트 API서버

안녕하세요 8장 까지 마무리 하고 product 이미지 가 출력되지 않는 현상을 봤습니다. 확실한건 이미지 링크는 header에 Authorization에 bearer token이 없어서 출력되지 않는거 같아요.. 일단 shouldNotFilter에 if(path.startsWith("/api/products/view")) { return true; } 해서 보이게 했긴해지만 결국에는 링크도 토큰 인증 처리해야겠죠?

  • react
  • spring-boot
  • jpa
  • jwt
  • redux-toolkit
just kim 댓글 1 좋아요 0 조회수 141

Check the render method of `TabBarIcon`.

미해결

따라하며 배우는 리액트 네이티브 기초

이런게 뜨는데 npm라이브러리가 잘못된건가요? react-native-cli라 expo라이브러리를 쓸수도 없고...

  • react
  • react-native
Ryu JangHyun 댓글 3 좋아요 0 조회수 177

Join 구문에서 메인 테이블

미해결

[리뉴얼] 처음하는 SQL과 데이터베이스(MySQL) 부트캠프 [입문부터 활용까지]

SELECT provider FROM items JOIN ranking on ranking.item_code = items.item_code 여기서 items 위치를 메인 테이블 ranking 위치를 서브 테이블이라고 칭할게요! 메인테이블과 서브테이블을 어떤걸로 해야할지 항상 헷갈려요 기본적으로 보고 싶은 컬럼인 provider가 원래 속한 테이블을 메인에 두려고는 하는데 예제 풀어주시는 걸 보면 아닌 경우도 있어서요! 어차피 테이블을 조인하는거니까 하나의 테이블이 되면 뭐가 메인이 되어도 상관이 없지않나 싶은데.. 메인 테이블 지정하는 기준이 있나요??

  • python
  • sql
  • mysql
  • dbms/rdbms
  • 데이터-엔지니어링
dmsal0544 댓글 1 좋아요 0 조회수 196

3장_ next-auth 로그인하기 / 로그인 시 ID,Password 정보 어디에 있나요?

미해결

Next + React Query로 SNS 서비스 만들기

마지막에 로그인시 저는 http://localhost:3000/api/auth/error "이 페이지는 존재하지 않습니다. 다른 페이지를 검색해 보세요 검색" 위 URL로 리다이렉트 되고 해당 ㅁㅔ시지가 뜹니다. 혹시 어디에 있는 정보로 로그인하는건지 궁금합니다

  • react
  • next.js
  • react-query
  • next-auth
  • msw
슈퍼아스라다 댓글 2 좋아요 0 조회수 303

셀레니움 headless 옵션 추가시 크롤링 안되는 현상

미해결

[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)

안녕하세요. 셀레니움으로 개발된 프로그램을 GUI로 감싸서 만들어 보려고 하고 있습니다. 아래 코드에서 크롬 창이 뜨도록 하면 잘 실행되면 elem에 데이터가 들어옴을 확인할 수 있습니다. 1번을 확인 후 headless 옵션을 주고 실행하면 창은 뜨지 않고 실행되나, 데이터를 가져오지 못합니다. 구글링도 해보고, GPT도 물어봤지만 답을 찾을 수 없어서 문의 드리게 되었습니다. 확인 부탁드립니다. from selenium import webdriver # from selenium.webdriver.chrome.options import Options from selenium.webdriver.chrome.service import Service from webdriver_manager.chrome import ChromeDriverManager # 크롬 드라이버 자동 업데이트을 위한 모듈 from selenium.webdriver.common.by import By # from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver import ActionChains # 스크롤시 사용 from selenium.webdriver.support import expected_conditions as EC import time from bs4 import BeautifulSoup as bts import pandas as pd import os from datetime import datetime ################################### # Window 열고, 네이버 지도에서 검색 ################################### options = webdriver.ChromeOptions() options.add_argument('headless') # service = Service(ChromeDriverManager().install()) # driver = webdriver.Chrome(options=options) driver = webdriver.Chrome() # driver = webdriver.Chrome(ChromeDriverManager().install()) action = ActionChains(driver) keyword = '서울 강남구 정보통신' url = f'https://map.naver.com/p/search/{keyword}' driver.get(url) # WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.XPATH, '//*[@id="searchIframe"]'))) time.sleep(20) search_iframe() elem = driver.find_elements(By.CSS_SELECTOR, '.place_bluelink.C6RjW > span.YwYLL') # 이름 name_list = [e.text for e in elem] elem

  • python
  • 웹-크롤링
초칼라 댓글 2 좋아요 0 조회수 1135

fetch 옵션에 cache no-store 사용하면 tags 사용안해도 되는거 아닌가요???

미해결

Next + React Query로 SNS 서비스 만들기

export async function getSearchResult({ queryKey }) { const [_1, _2, searchParams] = queryKey; const res = await fetch(api url, next: { tags: ["posts", "search", searchParams] }, cache: 'no-store' ) } next tags를 사용하는이유가 revalidate를 하기 위해서인데 fetch 옵션을 'no-store'로 주면 캐시가 되지 않는걸로 알고있어서 tags 사용안해도 되지않나요??

  • react
  • react-query
  • next-auth
  • msw
  • nextjs
윤선지 댓글 1 좋아요 0 조회수 250

수정해보았는데 답장이 오지 않습니다.

미해결

따라하며 배우는 노드, 리액트 시리즈 - 챗봇 사이트 만들기

send를 누르면 터미널에 이렇게 뜹니다. Server Running at 5000 C:\project\vswork\chatbot-app-master\node_modules\google-gax\node_modules\google-auth-library\build\src\auth\jwtclient.js:193 throw new Error('The incoming JSON object does not contain a client_email field'); ^ Error: The incoming JSON object does not contain a client_email field at JWT.fromJSON (C:\project\vswork\chatbot-app-master\node_modules\google-gax\node_modules\google-auth-library\build\src\auth\jwtclient.js:193:19) at GoogleAuth._cacheClientFromJSON (C:\project\vswork\chatbot-app-master\node_modules\google-gax\node_modules\google-auth-library\build\src\auth\googleauth.js:313:16) at ReadStream.<anonymous> (C:\project\vswork\chatbot-app-master\node_modules\google-gax\node_modules\google-auth-library\build\src\auth\googleauth.js:347:36) at ReadStream.emit (node:events:519:28) at endReadableNT (node:internal/streams/readable:1696:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) Node.js v20.16.0 PS C:\project\vswork\chatbot-app-master> 아래와 같이 값이 입력이되어있는데도말입니다. 루트파일에다가 구글 인증json을 위치를 끌어다 넣어도 그렇습니다. 가르쳐줘서 고맙습니다. 근데 이렇게 문제가 생겨서 이 구간을 벗어나고 싶습니다 ㅠㅠ

  • react
  • node.js
코딩의외로 댓글 1 좋아요 0 조회수 308

비교연산자와 반복문+조건문 문제 풀이 강의 질문이요.

해결됨

(2026 최신!) 일주일만에 합격하는 정보처리기사 실기

13:05부터 약간 문제풀이가 이해가 안 되어가지구요. 1 2 3 4 5 6 7 8 9 10 int=i sum=0 첫번째 if문 sum+=i*i; i%2 == 1 -> 2로 나누어서 나머지가 1값이 나오면 곱셈하라는 이야기이죠? 그러면 홀수인 1 3 5 7 9는 (1*1, 3*3, 5*5, 7*7, 9*9) 하라는 이야기이네요? 두번재 else 에서는 sum-= i; -> 음수값 붙이라는 이야기인가요? 그러면 짝수는 (-2, -4, -6, -8, -10) 이라는 이야기이네요? 거기서 1 2 3 4 5 6 7 8 9 10 처음 sum 값은 0이니 홀수는 1*1해서 1값이 나온거고 다음 짝수는 첫번째 sum 값인 1*1 에서 -2를 더해서 -1값이 나온거고 그래서 1 2 3 4 5 6 7 8 9 10 1 -1 8 4 29 23 72 64 145 135 (1*1) = 1 {(1*1) = 1} -2 = -1 (3*3)-1 = 8 {(3*3)-1 = 8} -4 = 4 이렇게 순서대로 이해하면 되나요? 이게 맞는건가요? 비전공자라 이해가 잘 안되서 여쭙니다. 감사합니다.

  • python
  • java
  • c
  • 정보처리기사
tjdgusl1987 댓글 1 좋아요 0 조회수 106

시간초과를 자력으로 해결하지 못했습니다 😓

해결됨

세계 대회 진출자가 알려주는 코딩테스트 A to Z (with Python)

안녕하세요, 강의를 듣고 계신 여러분! 여러분의 학습을 돕기 위해 질문 안내를 드리고자 합니다. 1. chatGPT를 이용해보기 단순한 의문은 chatGPT를 이용해도 해답을 찾을 수 있는 경우가 종종 있습니다! 2. 강의의 어떤 부분에 대한 질문이고, 어떤 부분이 궁금한지 명확히 알려주세요! 강의의 어느 파트에서 의문을 느끼고, 어떤 부분이 궁금한지 를 명확히 제시해 주시면 답변에 도움이 됩니다! 자신은 어떻게 이해했는지 또한 적어주면 좋습니다! ex) 섹션5의 '그래프 순회 (DFS & BFS) [개념]' 강의 에서 DFS와 BFS 모두 그래프의 모든 노드를 탐색하는 알고리즘이라고 하셨고 시간 복잡도 또한 똑같다고 이해 했습니다. 그러면 DFS와 BFS 중에서 어떤 알고리즘이 더 효율적인지 구별하는 것은 의미가 없는 것일까요? 어느 파트 섹션5의 '그래프 순회 (DFS & BFS) [개념]' 강의 자신은 어떻게 이해했는지 DFS와 BFS 모두 그래프의 모든 노드를 탐색하는 알고리즘이라고 하셨고 시간 복잡도 또한 똑같다고 이해 어떤 부분이 궁금한지 DFS와 BFS 중에서 어떤 알고리즘이 더 효율적인지 구별하는 것은 의미가 없는 것일까요? 안녕하세요. 선생님. 저번 설명과 조언 너무 감사합니다. 그,, 백준 2580 스도쿠에 관한 질문인데요, 시간 초과를 해결하지 못하였는데, 각각을 보면 그렇게까지 시간이 많이 들지는 않을 거 같다는 생각도 들구.. 재귀를 사용하지는 않았지만, 어디서 시간이 많이 걸리는 지 분석이 안되어서요.. 선생님 도움이 필요해서 질문 남깁니다.. arr = [list(map(int, input().split())) for _ in range(9)] # 스도구 문제 배열 idxs = [] # 인덱스 쌍을 담는 배열 for i in range(9): for j in range(9): if not arr[i][j]: idxs.append((i,j)) def fillHori(y, x): # 가로 nums = 45 # 1~9까지의 합 for i in range(9): if x == i: continue # 자기 자신 탐색 제외 if arr[y][i] == 0: return 0 # 0이 또 있으면 채울 수 없음 nums -= arr[y][i] return nums def fillVerti(y, x): #세로 nums = 45 # 1~9까지의 합 for i in range(9): if y == i: continue # 자기 자신 탐색 제외 if arr[i][x] == 0: return 0 # 0이 또 있으면 채울 수 없음 nums -= arr[i][x] return nums def fillSquare(y, x): #사각형 nums = 45 # 1~9까지의 합 for i in range(y // 3 * 3, y // 3 * 3 + 3): for j in range(x // 3 * 3, x // 3 * 3 + 3): if y == i and x == j: continue # 자기 자신 탐색 제외 if arr[i][j] == 0: return 0 # 0이 또 있으면 채울 수 없음 nums -= arr[i][j] return nums def fillCrossDown(y, x): # 대각선(안씀) nums = 45 # 1~9까지의 합 for i in range(9): for j in range(9): if y == i and x == j: continue # 자기 자신 탐색 제외 if arr[i][j] == 0: return 0 # 0이 또 있으면 채울 수 없음 if y - x == j - i: nums -= arr[i][j] return nums def fillCrossUp(y, x): # 대각선(안씀) nums = 45 # 1~9까지의 합 for i in range(9): for j in range(9): if y == i and x == j: continue # 자기 자신 탐색 제외 if arr[i][j] == 0: return 0 # 0이 또 있으면 채울 수 없음 if y + x == j + i: nums -= arr[i][j] return nums while idxs: for i, j in idxs: n = fillHori(i, j) if n: arr[i][j] = n; idxs.remove((i,j)); continue n = fillVerti(i, j) if n: arr[i][j] = n; idxs.remove((i,j)); continue n = fillSquare(i, j) if n: arr[i][j] = n; idxs.remove((i,j)); continue n = fillCrossUp(i, j) if n: arr[i][j] = n; idxs.remove((i,j)); continue n = fillCrossDown(i, j) if n: arr[i][j] = n; idxs.remove((i,j)) for a in arr: for i in a: print(i, end = ' ') print()

  • python
  • 코딩-테스트
  • 알고리즘
zhu 댓글 2 좋아요 0 조회수 231

주소

해결됨

[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스

주소 안들어가집니다/

  • react
  • node.js
  • seo
  • graphql
  • next.js
imhj11777 댓글 4 좋아요 0 조회수 270

머신러닝 - surprise 모듈 설치 오류

미해결

파이썬 무료 강의 (활용편7) - 머신러닝

프로젝트 단계에서 surprise 모듈을 설치할 수가 없어요. !pip install scikit-surprise 이후에 출력된 내용 중 하단에 다음과 같이 오류 메시지가 뜹니다. note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for scikit-surprise ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (scikit-surprise) 어떤 문제인지, 어떻게 해결해야 하는지 궁금합니다.

  • python
  • 머신러닝
  • anaconda
  • scikit-learn
서승아 댓글 1 좋아요 0 조회수 384

포인터 강의와 더불어서 24년2회 기출문제 swap 낚시문제 질문있어요

해결됨

(2026 최신!) 일주일만에 합격하는 정보처리기사 실기

29분 포인트 강의를 보다보니 24년2회 swap 낚시문제가 떠올라서 질문드립니다. void swap(){ int temp; temp =a; a = b; b = temp; } int main(){ int a = 11; int b = 19; swap(); 기출2회 일부 추출인데요.. 해당 스왑부분을 보면 포인터변수를 준 것 외엔 차이가 없어 보입니다. 위 기출의 경우엔 왜 스왑이 될 수 없는지 부연설명이 있으면 이해가 빠를 것 같아요! (스왑 함수에서 temp값에 a넣어주고 a에 b를 대입하고.. 포인터변수 외엔 차이를 못느끼겠습니다.)

  • python
  • java
  • c
  • 정보처리기사
주서 댓글 1 좋아요 0 조회수 278

강의 자료 부탁드립니다.

해결됨

팀 개발을 위한 Git, GitHub 입문

안녕하세요. 강의 잘보고 있습니다. PPT 자료를 다운 받고 싶은데, 어디서 다운받아야 할지 모르겠네요. 시간되실때 이메일로 보내주시면 감사하겠습니다. 이메일 : shinyeoneui@naver.com

  • git
  • github
  • 버전관리시스템
shinyeoneui 댓글 2 좋아요 0 조회수 218

개인 포폴작업중인데 백엔드 인가를 어떤식으로 구현해야할까요..

미해결

Next + React Query로 SNS 서비스 만들기

제로초님의 next-auth 작업하시는걸 보고 프론트에서 next-auth로 로그인하는것을 구현을 하긴 했는데 로그인(인가)을 하는 주체가 프론트다 보니 기존에 배웠을때는 nest 또는 node에서 passport를 이용해서 작업을 했엇는데 이제는 passport로 인가 하는 작업이 필요가 없어진건지 궁금합니니다. 필요가 없다라고 하면 백엔드서버에서는 이사람이 로그인을 했는지 안했는지를 알아야 할텐데 그거는 어떻게 구현을 해야할지가 막막해서 질문드립니다 ㅠㅠ

  • react
  • next.js
  • react-query
  • next-auth
  • msw
GI P 댓글 1 좋아요 0 조회수 217

InputForm 생성하기에서 TextInput과 Pressable이 보이지 않아요.

미해결

따라하며 배우는 리액트 네이티브 기초

레이아웃 표시를 했을때, 위치는 잡히는 것 같지만 시각적으로 전혀 보이지 않아요. 마치 뒤에 가려진 것 처럼요 // InputForm.js import { KeyboardAvoidingView, Platform, Pressable, StyleSheet, Text, TextInput, View } from 'react-native' import React from 'react' const InputForm = () => { return ( <KeyboardAvoidingView behavior={Platform.OS === 'ios' ? 'padding' : 'height'} style={styles.addFormContainer}> <TextInput style={styles.inputField} placeholder="할 일을 작성해주세요." /> <Pressable style={styles.addButton}> <Text style={styles.addButtonText} >+</Text> </Pressable> </KeyboardAvoidingView> ) } export default InputForm const styles = StyleSheet.create({ addFormContainer: { flexDirection: 'row', marginTop: 'auto', marginBottom: 30, paddingHorizontal: 20, backgroundColor: '#f7f8fa' }, inputField: { flex: 1, height: 42, padding: 5, marginRight: 25, borderRadius: 4, borderColor: 'rgba(0, 0, 0, 0.2)', borderWidth: 1, color: '#000000', fontSize: 15, textAlignVertical: 'center' }, addButton: { justifyContent: 'center', alignItems: 'center', width: 42, height: 42, borderRadius: 4, backgroundColor: 'rgba(0,0,0,0.7)', shadowColor: '#000000', shadowOpacity: 0.14, shadowRadius: 8, shadowOffset: { width: 0, height: 4 } }, addButtonText: { color: 'white', fontSize: 25 }, }) // MainScreen.js import { SafeAreaView, StyleSheet, Text, View, StatusBar, Platform } from 'react-native' import React from 'react' import InputForm from '../components/InputForm' const MainScreen = () => { return ( <View> <SafeAreaView style={styles.container}> <StatusBar barStyle={'default'} /> <Text style={styles.pageTitle}>ToDo App</Text> <View style={styles.listView}> <Text style={styles.listTitle}>할 일</Text> </View> <View style={styles.separator} /> <View style={styles.listView}> <Text style={styles.listTitle}>완료된 일</Text> </View> <InputForm /> </SafeAreaView> </View> ) } export default MainScreen const styles = StyleSheet.create({ container: { flex: 1, paddingTop: Platform.OS = 'android' ? 20 : 0, backgroundColor: '#f7f8fa' }, pageTitle: { marginBottom: 35, paddingHorizontal: 15, fontSize: 54, fontWeight: '600', }, separator: { marginHorizontal: 10, marginTop: 25, marginBottom: 10, borderBottomWidth: 1, borderBottomColor: 'rgba(0,0,0,0.2)' }, listView: { flex: 1, }, listTitle: { marginBottom: 25, paddingHorizontal: 15, fontSize: 41, fontWeight: '500', } }) // App.js import { StyleSheet, Text, View } from 'react-native'; import MainScreen from './screens/MainScreen'; export default function App() { return ( <View style={styles.container}> <MainScreen /> </View> ); } const styles = StyleSheet.create({ container: { flex: 1, backgroundColor: '#fff', alignItems: 'flex-start', justifyContent: 'center', }, }); // package.json { "name": "awesomeproject", "version": "1.0.0", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web" }, "dependencies": { "expo": "^51.0.27", "expo-status-bar": "~1.12.1", "react": "18.2.0", "react-native": "0.74.5" }, "devDependencies": { "@babel/core": "^7.24.0" }, "private": true }

  • react
  • react-native
  • expo
ehdns1133 댓글 1 좋아요 0 조회수 150

IP Field와 AccessLog 관련

해결됨

파이썬/장고 웹서비스 개발 완벽 가이드 with 리액트 (장고 4.2 기준)

질문을 온전히 이해할 수 있도록, 모든 맥락을 전달해주세요. 질문은 질문자가 번거로워야 보다 좋은 답변을 얻으실 수 있습니다. 시행착오를 알려주시면 곧바로 원하는 문제에 집중할 수 있습니다. 오류 메시지는 일부만 알려주시기보다 전체 오류 메시지를 캡처해서 주시면, 오류 파악에 도움이 됩니다. 당신의 파이썬/장고 페이스메이커가 되겠습니다. ;-) 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. Q1 7-01 02 강의에서 ipv4address custom field를 생성하셨는데요 8-20 강의 같이 이후에는 그냥 Django GenericIPAddressField를 사용셨습니다. 7-01 02강의는 그냥 custom 필드를 보여주기 위한 예시이고 그냥 장고에서 제공해주는 IP 필드를 사용하면 되는건가요? 아니면 차이점이 존재하는 건가요? Q2 제가 제작한 사이트의 사용량 집계를 위해 로그를 얻으려고 합니다. class AccessLog(models.Model): request = models.URLField() time = models.DateTimeField(auto_now=True) user = models.ForeignKey(User, on_delete=models.CASCADE, null=True) ip = models.GenericIPAddressField() 상기와 같은 모델을 작성하여 request가 client로 날라올 때마다 db에 쌓아나가는게 맞을까요? 아니라면 logger를 이용하는게 맞을까요?

  • react
  • python
  • django
  • web-api
  • htmx
pplkjh2 댓글 1 좋아요 0 조회수 142

강의의 eslintrc와 eslint.config의 차이가 무엇인가요?

해결됨

한 입 크기로 잘라 먹는 리액트(React.js) : 기초부터 실전까지

강의 6분 17초에 eslintrc 파일은 저에게는 eslint.config.js로 나와서 문의드립니다! 안에 내용도 좀 다르고 저는 eslint.config.js. 파일만 있어서요! 같다고 봐야할까요?

  • javascript
  • react
  • node.js
cei8645 댓글 2 좋아요 2 조회수 1486

postman 에 답이 오지 않습니다.(수정)

미해결

따라하며 배우는 노드, 리액트 시리즈 - 챗봇 사이트 만들기

브라우저를 실행 했습니다 문제는 이렇게 보내고 이런 에러가 났습니다. 또한 터미널에는 아무런 값도 뜨지않고 이상태 그대로 입니다. 무엇이 문제일까요?아래 처럼되지 않습니다. <예제가 바르게 작동된 모습> const express = require('express'); const router = express.Router(); const structjson = require('./structjson.js'); const dialogflow = require('dialogflow'); const uuid = require('uuid'); const config = require('../config/keys'); const projectId = config.googleProjectID const sessionId = config.dialogFlowSessionID const languageCode = config.dialogFlowSessionLanguageCode // Create a new session const sessionClient = new dialogflow.SessionsClient(); const sessionPath = sessionClient.sessionPath(projectId, sessionId); // We will make two routes // Text Query Route router.post('/textQuery', async (req, res) => { //We need to send some information that comes from the client to Dialogflow API // The text query request. const request = { session: sessionPath, queryInput: { text: { // The query to send to the dialogflow agent text: req.body.text, // The language used by the client (en-US) languageCode: languageCode, }, }, }; // Send request and log result const responses = await sessionClient.detectIntent(request); console.log('Detected intent'); const result = responses[0].queryResult; console.log(` Query: ${result.queryText}`); console.log(` Response: ${result.fulfillmentText}`); res.send(result) }) //Event Query Route router.post('/eventQuery', async (req, res) => { //We need to send some information that comes from the client to Dialogflow API // The text query request. const request = { session: sessionPath, queryInput: { event: { // The query to send to the dialogflow agent name: req.body.event, // The language used by the client (en-US) languageCode: languageCode, }, }, }; // Send request and log result const responses = await sessionClient.detectIntent(request); console.log('Detected intent'); const result = responses[0].queryResult; console.log(` Query: ${result.queryText}`); console.log(` Response: ${result.fulfillmentText}`); res.send(result) }) module.exports = router; const express = require("express"); const path = require("path"); const bodyParser = require("body-parser"); const app = express(); const config = require("./server/config/keys"); // const mongoose = require("mongoose"); // mongoose.connect(config.mongoURI, { useNewUrlParser: true, useUnifiedTopology: true }) // .then(() => console.log('MongoDB Connected...')) // .catch(err => console.log(err)); app.use(bodyParser.urlencoded({ extended: true })); app.use(bodyParser.json()); app.use('/api/dialogflow', require('./server/routes/dialogflow')); // Serve static assets if in production if (process.env.NODE_ENV === "production") { // Set static folder app.use(express.static("client/build")); // index.html for all page routes app.get("*", (req, res) => { res.sendFile(path.resolve(__dirname, "client", "build", "index.html")); }); } const port = process.env.PORT || 5000; app.listen(port, () => { console.log(`Server Running at ${port}`) }); { "name": "chatbot-app", "version": "1.0.0", "description": "chatbot-app", "main": "index.js", "engines": { "node": ">=20.16.0", "npm": ">=10.2.0" }, "scripts": { "start": "node index.js", "backend": "nodemon index.js", "frontend": "npm run front --prefix client", "dev": "concurrently \"npm run backend\" \"npm run start --prefix client\"" }, "author": "Jaewon Ahn", "license": "ISC", "dependencies": { "actions-on-google": "^2.6.0", "body-parser": "^1.18.3", "dialogflow": "^1.2.0", "dialogflow-fulfillment": "^0.6.1", "express": "^4.16.4", "mongoose": "^5.4.20" }, "devDependencies": { "concurrently": "^4.1.0", "nodemon": "^1.18.10" } }

  • react
  • node.js
코딩의외로 댓글 1 좋아요 0 조회수 294

인기 태그

인프런 TOP Writers

주간 인기글