본문 바로가기

전체 글47

strapi collection type추가 strapi에서 collection type은 DB의 table과 동일하다고 생각하면 된다. 실제로 collection type을 추가하면 실제로 DB table이 추가되며, strapi가 재시작된다. Content-Types Builder메뉴 클릭 + Create new collection type 클릭 collection type을 추가하기 위한 첫 번째 단계로 collection의 이름을 정하는 다이얼 로그가 나타난다. Display name이 보통의 table이름으로 생각하면 된다. 단 대소문자를 섞는다 해도, 실제로 table은 소문자로 생성되며, Contents-Types 메뉴에서 Dispaly name으로 보이게 된다. UID는 자동으로 생성되기 때문에 직접 작성할 필요가 없다. UID의 경.. 2020. 10. 12.
str api, DB와 RestAPIs 모든 세팅을 끝나고 나면, 이제 DB와 API를 생성할 수 있는 상태가 된 것이다. 이후 부터 기본적인 CRUD가 가능한 Server를 Control 할 수 있게 된다. DB strapi에서 DB는 Collection Types라는 이름으로 DB Table을 나타낸다. 동시에 Users, User라는 Rest API의 Router도 생성된다. sqlite 기준으로 기본적으로 생성된 DB를 보면 아래와 같다. 다른 것들은 strapi의 기본적인 기느들과 관련되거나, role등에 관련된 것이라서 직접 손댈일이 없다. users-permissions_user라는 Table을 볼 수 있으며, Collection Types Users에 매핑되는 Table이다. 테이블 이름의 규칙 기본적으로 strapi가 생성하는.. 2020. 10. 4.
strapi Admin & User 1. Strapi 초기 계정 설정 처음 strapi를 설치되면, 가장 처음 화면이 super admin을 설정하는 화면이다. 여기에서 설정하는 admin user는 strapi의 모든 기능에 access할 수 있는 user이다. 2. strapi user? user의 종류 user: DB table에 존재하는 회원 정보 같은 것 admin user: System Admin으로 strapi Dashboard에 로그인 하고 설정을 바꾸는 것 등이 가능 기본적으로 strapi는 user타입이 2가지 인데, 위 처름 dashboard에 로그인하고, dashboard에서 strapi를 컨트롤하는 user가 있고, strapi가 data와 api로 제공해주는 user가 따로 존재한다. 위의 admin을 설정하면 아.. 2020. 9. 24.
strapi Server & DB configuration 살펴보기 Configuration strapi db configuration strapi config folder strapi project로 생성된 폴더중 config라는 폴더를 확인할 수 있다. 기본적으로 2개의 파일을 확인 할 수 있다. database.js: database setting sourcecode 아래 코드는 기본적으로 생성되는 sqlite의 경우. module.exports = ({ env }) => ({ defaultConnection: 'default', connections: { default: { connector: 'bookshelf', settings: { client: 'sqlite', filename: env('DATABASE_FILENAME', '.tmp/data.db'), }.. 2020. 9. 15.