소개
게시글
질문&답변
2021.08.27
404 에러가 떠서 질문드립니다
아 제로초님 해결했습니다!! router/user.js에 연결이 잘못되있었습니다 좋은 강의 항상 감사합니다
- 0
- 1
- 90
질문&답변
2021.08.26
팔로우 팔로잉 관계가 작동하지 않습니다ㅜ
아이디 1로 2 3 4 5 6까지 모두 팔로잉 한후에 로그인을 하면 (사진) 이렇게 콘솔찍어보면 뜹니다. 이게 팔로우에 다 들어와있다는 뜻 아닌가요??ㅜ
- 0
- 1
- 207
질문&답변
2021.08.11
500 status
(사진) (사진)
- 0
- 2
- 195
질문&답변
2021.08.11
500 status
app.js const express = require ( 'express' ); const cors = require ( 'cors' ) const db = require ( './models' ) const app = express (); db . sequelize . sync (); app . use ( cors ( 'http://localhost:3000' )) app . use ( express . json ()) app . use ( express . urlencoded ({ extended : false })) app . get ( '/' , ( req , res ) => { res . status ( 200 ). send ( 'Hello backend' ) }) app . post ( '/user' , async ( req , res , next ) => { try { const newUser = await db . User . create ({ where : { nickname : req . body . nickname , email : req . body . email , password : req . body . password , } }) res . status ( 201 ). json ( newUser ); } catch ( err ) { console . log ( err ) next ( err ) } }) app . listen ( 3085 , () => { console . log ( `백엔드 서버 ${ 3085 } 번 포트에서 작동중` ) }) user.js module . exports = ( sequelize , DataTypes ) => { const User = sequelize . define ( 'User' , { email : { type : DataTypes . STRING ( 40 ), allowNull : false , }, nickname : { type : DataTypes . STRING ( 20 ), allowNull : false , }, password : { type : DataTypes . STRING ( 100 ), allowNull : false , }, }, { charset : 'utf8' , collate : 'utf8_general_ci' }) User . associate = ( db ) => { } return User } front의 signup.vue methods : { onSubmitForm () { if ( this . $refs . form . validate ()) { this . $store . dispatch ( 'users/signUp' , { nickname : this . nickname , email : this . email , password : this . password }) . then (() => { this . $router . push ({ path : '/' }); }) . catch (() => { alert ( '회원가입 실패' ) }) } } }, front의 user.js signUp ({ commit , state }, payload ) { this . $axios . post ( 'http://localhost:3085/user' , { nickname : payload . nickname , email : payload . email , password : payload . password , }); commit ( 'setMe' , payload ) },
- 0
- 2
- 195
질문&답변
2021.08.10
강의 듣는중 에러가 떠서 질문 드립니다 ㅜ
index.js 에 '../config/config.json 이부분 앞에 슬래쉬 하나가 더 들어 간거 같아서 제거하고 npm run dev를 해보니 이번엔 좀 다르게 뜨네요 ㅜㅜ [nodemon] restarting due to changes... [nodemon] starting `node app.js` 백앤드 서버 3085번 포트에서 작동중 (node:26792) UnhandledPromiseRejectionWarning: SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:3306 at ConnectionManager.connect (C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\dialects\mysql\connection-manager.js:116:17) at processTicksAndRejections (internal/process/task_queues.js:93:5) at async ConnectionManager._connect (C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:318:24) at async C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:250:32 at async ConnectionManager.getConnection (C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:280:7) at async C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\sequelize.js:613:26 at async MySQLQueryInterface.createTable (C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\dialects\abstract\query-interface.js:225:12) at async Function.sync (C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\model.js:1300:5) at async Sequelize.sync (C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\sequelize.js:793:35) (Use `node --trace-warnings ...` to show where the warning was created) (node:26792) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:26792) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. 빨갛게 뜨지 않는거 보니 에러같은건 아닌거 같은데 ㅜ 백앤드 들어와서 힘드네요 ㅜ
- 0
- 5
- 786