소개
게시글
질문&답변
2022.02.23
로컬에서 권한문제? 같은 에러가 있습니다.
도메인에 http://127.0.0.1:3060/ 로 접속하라는 말씀이신가요? 그렇게 접속했는데 여전히 같은 증상을 보입니다~ (사진) 혹시몰라서 config.js파일에서 (사진) backUrl도 변경해봤는데 반응하지 않네요.. (사진)
- 0
- 2
- 109
질문&답변
2022.01.20
마이그레이션 관련 질문입니다~
마이그레이션 진행 중 어느순간부터 (사진) 이에러가 뜨는데 도무지 감을 잡기가 힘드네요. models/index.js const Sequelize = require ( ' sequelize ' ) ; const user = require ( ' ./user ' ) ; const withdraw = require ( ' ./withdraw ' ) ; const education = require ( ' ./education ' ) ; const career = require ( ' ./career ' ) ; const job = require ( ' ./job ' ) ; const activity = require ( ' ./activity ' ) ; const award = require ( ' ./award ' ) ; const certification = require ( ' ./certification ' ) ; const language = require ( ' ./language ' ) ; const project = require ( ' ./project ' ) ; const social = require ( ' ./social ' ) ; const comtest = require ( ' ./comtest ' ) ; const teamreview = require ( ' ./teamreview ' ) ; // const comment = require('./comment'); const skill = require ( ' ./skill ' ) ; const userskill = require ( ' ./userskill ' ) ; const certificationpool = require ( ' ./certificationpool ' ) ; const company = require ( ' ./company ' ) ; const division = require ( ' ./division ' ) ; const university = require ( ' ./university ' ) ; const course = require ( ' ./course ' ) ; const coursepool = require ( ' ./coursepool ' ) ; const jobcomment = require ( ' ./jobcomment ' ) ; // 배포시 process.env.NODE_ENV를 prodution으로 변경 // develop모드에서 config를 가져옴 const env = process . env . NODE_ENV || ' development ' ; const config = require ( ' ../config/config ' )[env] ; const db = {}; // sequelize로 node mySQL 연결 const sequelize = new Sequelize (config . database , config . username , config . password , config) ; db . User = user ; db . Job = job ; db . Skill = skill ; db . Userskill = userskill ; db . Education = education ; db . Career = career ; db . Activity = activity ; db . Award = award ; db . Certification = certification ; db . Withdraw = withdraw ; db . Language = language ; db . Project = project ; db . Social = social ; db . Comtest = comtest ; db . Teamreview = teamreview ; db . Certificationpool = certificationpool ; db . Division = division ; db . University = university ; db . Company = company ; db . Course = course ; db . Coursepool = coursepool ; db . Jobcomment = jobcomment ; // db.Post = post; Object . keys (db) . forEach ( modelName => { db[modelName] . init (sequelize) ; } ) ; // 관계형db 실행문(associate) Object . keys (db) . forEach ( modelName => { if (db[modelName] . associate) { db[modelName] . associate (db) ; } } ) ; db . sequelize = sequelize ; db . Sequelize = Sequelize ; module . exports = db ; create DB로 새로운db 생성형태 이건 DB파일형태 ' use strict ' ; const { Model } = require ( ' sequelize ' ) ; module . exports = ( sequelize , DataTypes ) => { class Coursepool extends Model { /** * Helper method for defining associations. * This method is not a part of Sequelize lifecycle. * The `models/index` file will call this method automatically. */ static associate ( models ) { models . Coursepool . hasOne (models . Course) ; models . Coursepool . belongsTo (models . User) ; models . Coursepool . belongsToMany (models . Skill , { through : ' CoursepoolSkill ' , foreignkey : " CoursepoolId " } ) models . Coursepool . belongsToMany (models . Certificationpool , { through : ' Certification_Course ' , foreignkey : " CoursepoolId " } ) } }; Coursepool . init ( { name : DataTypes . STRING }, { period : DataTypes . FLOAT }, { runningtime : DataTypes . FLOAT }, { cost : DataTypes . FLOAT }, { teacher : DataTypes . STRING }, { category : DataTypes . STRING }, { image : DataTypes . STRING }, { viewcount : DataTypes . INTEGER }, { intro : DataTypes . STRING }, { url : DataTypes . STRING }, { process : DataTypes . INTEGER ( 2 ) }, { rate_inside : DataTypes . FLOAT }, { rate : DataTypes . FLOAT }, { sequelize , modelName : ' Coursepool ' , tableName : ' coursepools ' , } ) ; return Coursepool ; }; 이건 마이그레이션 파일입니다. ' use strict ' ; module . exports = { up : async ( queryInterface , Sequelize ) => { await queryInterface . createTable ( ' Jobcomment ' , { id : { allowNull : false , autoIncrement : true , primaryKey : true , type : Sequelize . INTEGER }, content : { type : Sequelize . TEXT , }, createdAt : { allowNull : false , type : Sequelize . DATE }, updatedAt : { allowNull : false , type : Sequelize . DATE } } ) }, down : async ( queryInterface , Sequelize ) => { await queryInterface . dropTable ( ' Jobcomment ' ) ; } }; 이런 식으로 디비구성하고 마이그레이션 작동은 되는데(테이블도 생성됩니다) back에서 npm run dev로 진행할 경우 에러가 뜨네요 ㅠ 혹시 원인 어떤건지 알 수 있을까요?ㅠ
- 0
- 2
- 685
질문&답변
2021.11.07
제로초님 죄송하지만 하나만 더 여쭤볼게요 ㅠ
next폴더 삭제 및 다시 전체를 git pull로 받아서 해결했더니 CSS 적용이 안되네요(뒤늦게 됨) 다른 페이지 이동후에 다시 들어가면 css가 적용되고 에고 ㅠㅠ
- 0
- 1
- 102
질문&답변
2021.11.06
안녕하세요 제로초님 배포후 에러가 발생해서 문의드립니다 ㅠ
리버스 프록시 해보고 질의응답 찾아가며도 고쳐봐도 쉽지않네요.. 말씀하신 것처럼 nginx가 노드서버를 가리키도록 하기 위해서는 conf파일을 수정해야할 것 같아서 작업중인데 딱히 틀린것 같진 않지만 계속 보고 있습니다 ㅠ (사진) (사진) (app.js 리버스프록시 적용 수정내용) (사진) (사진) nginx를 다시설치해서 해봐도 같네요
- 0
- 3
- 262
질문&답변
2021.11.06
안녕하세요 제로초님 배포후 에러가 발생해서 문의드립니다 ㅠ
postman으로 다른 요청도 해봤는데 404에러가 나는거 보면 연결자체가 문제가 있는건가요? (사진) (사진) pm2 monit하면 연결성공으로 나오는데 이거랑은 다른건가요? ㅠㅠ
- 0
- 3
- 262