본문 바로가기

-

(16)
[React]tui-editor 이미지 등록 이벤트 { const upload = await this.uploadImage(blob); callback(upload, "alt text"); return false; } }} /> /// uploadImage(blob) { let formData = new FormData(); formData.append('image', blob); return axios('http://localhost:3001/imageupload', { method: 'POST', data: formData, headers : {'Content-type' : 'multipart/form-data' } }).then(response => { if (response.data) { if(this.state.thumbnailcheck === ..
[React] styled-component 에서 colspan, rowspan 사용하기 import styled from "styled-components"; ............. {data.title} ............. const Title = styled.th` font-size: 30px; `;
[Express] passport-local-mongoose 간단정리(React 연동) 1. 설치 npm install passport passport-local passport-local-mongoose yarn add passport passport-local passport-local-mongoose 2. 스키마 모델 생성 /*user.js*/ /////////////////////// const mongoose = require('mongoose'); const passportLocalMongoose = require('passport-local-mongoose'); const userSchema = new mongoose.Schema({ username : { type : String }, nickname : { type : String }, Regi_date : { type : ..
[React]WYSIWYG toast-ui editor 사용하기 참고 - npm https://www.npmjs.com/package/@toast-ui/react-editor - api https://nhn.github.io/tui.editor/latest/ToastUIEditor#isViewer 1. 설치 npm install --save @toast-ui/react-editor yarn add @toast-ui/react-editor 2. 선언 import 'codemirror/lib/codemirror.css'; import '@toast-ui/editor/dist/toastui-editor.css'; import { Editor } from '@toast-ui/react-editor'; 3.코드 import React, { Component } from "re..
[mongoose] 스키마 모델에 배열로 저장하기 const book = new Schema({ keyword : {type : [String]} });
[express] Clova Face Recognition 예제 router.get("/face2", async function (req, res) { const [one, two] = await Promise.all([celebrity(), recognition()]); console.log("유명인 인식", one); console.log("얼굴 감지", two); res.json({data1 : one, data2 : two}) }); // 유명인 인식 celebrity = () => { return new Promise((resolve, reject) => { request.post(options, function (error, response, result) { if (!error && response.statusCode == 200) { const a = ..
[express]req.body 가 undefined 이라고 뜰 때 이유 : body-parser 가 깔려있지 않아서 해결법 1. body-parser 설치 2. app.use(express.json()); app.use(express.urlencoded( {extended : false } )); 추가
Axios로 get, post 진행 중 URL에 [object%20Object] 가 찍히는 현상 참조 : https://github.com/axios/axios axios/axios Promise based HTTP client for the browser and node.js - axios/axios github.com Axios.post({'https://openapi.naver.com/v1/papago/n2mt', data, header}) 이런 식으로 진행했는데, Axios.post('https://openapi.naver.com/v1/papago/n2mt', data, header) 로 바꾸니 해당 현상은 사라졌다.