kandi background
Explore Kits

strapi | Open source Node.js Headless CMS | Content Management System library

 by   strapi JavaScript Version: v4.1.8 License: Non-SPDX

 by   strapi JavaScript Version: v4.1.8 License: Non-SPDX

Download this library from

kandi X-RAY | strapi Summary

strapi is a JavaScript library typically used in Telecommunications, Media, Media, Entertainment, Web Site, Content Management System, Nodejs, MongoDB applications. strapi has no bugs, it has no vulnerabilities and it has medium support. However strapi has a Non-SPDX License. You can install using 'npm i strapi-email-amazon-ses' or download it from GitHub, npm.
🚀 Open source Node.js Headless CMS to easily build customisable APIs
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • strapi has a medium active ecosystem.
  • It has 44444 star(s) with 5452 fork(s). There are 638 watchers for this library.
  • There were 10 major release(s) in the last 12 months.
  • There are 422 open issues and 5958 have been closed. On average issues are closed in 110 days. There are 68 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of strapi is v4.1.8
strapi Support
Best in #Content Management System
Average in #Content Management System
strapi Support
Best in #Content Management System
Average in #Content Management System

quality kandi Quality

  • strapi has 0 bugs and 0 code smells.
strapi Quality
Best in #Content Management System
Average in #Content Management System
strapi Quality
Best in #Content Management System
Average in #Content Management System

securitySecurity

  • strapi has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • strapi code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
strapi Security
Best in #Content Management System
Average in #Content Management System
strapi Security
Best in #Content Management System
Average in #Content Management System

license License

  • strapi has a Non-SPDX License.
  • Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.
strapi License
Best in #Content Management System
Average in #Content Management System
strapi License
Best in #Content Management System
Average in #Content Management System

buildReuse

  • strapi releases are available to install and integrate.
  • Deployable package is available in npm.
  • Installation instructions, examples and code snippets are available.
  • It has 290 lines of code, 0 functions and 2472 files.
  • It has low code complexity. Code complexity directly impacts maintainability of the code.
strapi Reuse
Best in #Content Management System
Average in #Content Management System
strapi Reuse
Best in #Content Management System
Average in #Content Management System
Top functions reviewed by kandi - BETA

kandi has reviewed strapi and discovered the below as its top functions. This is intended to give you an instant insight into strapi implemented functionality, and help decide if they suit your requirements.

  • Creates a list view .
    • only used for select and select
      • Creates a new input .
        • List component .
          • Creates a list row .
            • Generate JSON builder
              • Create a new app instance .
                • Select multiple forms .
                  • Dynamic layout list of a dynamic component
                    • Synchronizes the layout and updates the layout

                      Get all kandi verified functions for this library.

                      Get all kandi verified functions for this library.

                      strapi Key Features

                      Modern Admin Panel: Elegant, entirely customizable and a fully extensible admin panel.

                      Secure by default: Reusable policies, CORS, CSP, P3P, Xframe, XSS, and more.

                      Plugins Oriented: Install the auth system, content management, custom plugins, and more, in seconds.

                      Blazing Fast: Built on top of Node.js, Strapi delivers amazing performance.

                      Front-end Agnostic: Use any front-end framework (React, Vue, Angular, etc.), mobile apps or even IoT.

                      Powerful CLI: Scaffold projects and APIs on the fly.

                      SQL databases: Works with PostgreSQL, MySQL, MariaDB, and SQLite.

                      strapi Examples and Code Snippets

                      See all related Code Snippets

                      ⏳ Installation

                      copy iconCopydownload iconDownload
                      yarn create strapi-app my-project --quickstart
                      

                      "gatsby develop" cannot run in Mac M1

                      copy iconCopydownload iconDownload
                      brew reinstall vips
                      xcode-select --install
                      brew install gcc
                      brew reinstall vips
                      brew info vips
                      npm i
                      

                      Changing image source property of a child with dangerously set innerhtml parent attribute in React

                      copy iconCopydownload iconDownload
                      let data = {
                        "Subscription": "standard",
                        "_id": "610bc1265aeb5e38e42c8220",
                        "Headline": "How to stop screwing yourself over",
                        "Description": "<p>How do you get on the road to being happier? Start by setting your alarm for 30 minutes earlier than usual and not hitting the snooze button. The effort required to leave that warm bed and enter the world is the same amount of effort needed to shake up your life and make that elusive change. In this humorous and provocative talk, Mel Robbins explains how turning off our brain's autopilot and demolishing our comfort zones is key to a rewarding life.</p><p><img src=\"/uploads/photo_1483985988355_763728e1935b_ixid_Mnwx_Mj_A3f_DB_8_M_Hxz_ZW_Fy_Y2h8_M_Xx8_Zm_Fza_Glvbnxlbnwwf_Hwwf_Hw_3_D_and_ixlib_rb_1_2_5186b4137a.1&amp;w=1000&amp;q=80\" alt=\"\"></p><p>Yet another image for fun <img src=\"/uploads/photo_1483985988355_763728e1935b_ixid_Mnwx_Mj_A3f_DB_8_M_Hxz_ZW_Fy_Y2h8_M_Xx8_Zm_Fza_Glvbnxlbnwwf_Hwwf_Hw_3_D_and_ixlib_rb_1_2_5186b4137a.1&amp;w=1000&amp;q=80\" alt=\"\"></p>",
                        "published_at": "2021-08-05T13:06:47.325Z"
                      }
                      
                      function addHost(str, host) {
                        return str.replaceAll('src=\"/uploads', `src=\"${host}/uploads`)
                      }
                      
                      console.log(addHost(data.Description, 'https://images.example.com'))
                      let data = {
                        "Subscription": "standard",
                        "_id": "610bc1265aeb5e38e42c8220",
                        "Headline": "How to stop screwing yourself over",
                        "Description": "<p>How do you get on the road to being happier? Start by setting your alarm for 30 minutes earlier than usual and not hitting the snooze button. The effort required to leave that warm bed and enter the world is the same amount of effort needed to shake up your life and make that elusive change. In this humorous and provocative talk, Mel Robbins explains how turning off our brain's autopilot and demolishing our comfort zones is key to a rewarding life.</p><p><img src=\"/uploads/photo_1483985988355_763728e1935b_ixid_Mnwx_Mj_A3f_DB_8_M_Hxz_ZW_Fy_Y2h8_M_Xx8_Zm_Fza_Glvbnxlbnwwf_Hwwf_Hw_3_D_and_ixlib_rb_1_2_5186b4137a.1&amp;w=1000&amp;q=80\" alt=\"\"></p><p>Yet another image for fun <img src=\"/uploads/photo_1483985988355_763728e1935b_ixid_Mnwx_Mj_A3f_DB_8_M_Hxz_ZW_Fy_Y2h8_M_Xx8_Zm_Fza_Glvbnxlbnwwf_Hwwf_Hw_3_D_and_ixlib_rb_1_2_5186b4137a.1&amp;w=1000&amp;q=80\" alt=\"\"></p>",
                        "published_at": "2021-08-05T13:06:47.325Z"
                      }
                      
                      function addHost(str, host) {
                        return str.split('src=\"/uploads').join(`src=\"${host}/uploads`)
                      }
                      
                      console.log(addHost(data.Description, 'https://images.example.com'))
                      let data = {
                        "Subscription": "standard",
                        "_id": "610bc1265aeb5e38e42c8220",
                        "Headline": "How to stop screwing yourself over",
                        "Description": "<p>How do you get on the road to being happier? Start by setting your alarm for 30 minutes earlier than usual and not hitting the snooze button. The effort required to leave that warm bed and enter the world is the same amount of effort needed to shake up your life and make that elusive change. In this humorous and provocative talk, Mel Robbins explains how turning off our brain's autopilot and demolishing our comfort zones is key to a rewarding life.</p><p><img src=\"/uploads/photo_1483985988355_763728e1935b_ixid_Mnwx_Mj_A3f_DB_8_M_Hxz_ZW_Fy_Y2h8_M_Xx8_Zm_Fza_Glvbnxlbnwwf_Hwwf_Hw_3_D_and_ixlib_rb_1_2_5186b4137a.1&amp;w=1000&amp;q=80\" alt=\"\"></p><p>Yet another image for fun <img src=\"/uploads/photo_1483985988355_763728e1935b_ixid_Mnwx_Mj_A3f_DB_8_M_Hxz_ZW_Fy_Y2h8_M_Xx8_Zm_Fza_Glvbnxlbnwwf_Hwwf_Hw_3_D_and_ixlib_rb_1_2_5186b4137a.1&amp;w=1000&amp;q=80\" alt=\"\"></p>",
                        "published_at": "2021-08-05T13:06:47.325Z"
                      }
                      
                      function addHost(str, host) {
                        return str.replaceAll('src=\"/uploads', `src=\"${host}/uploads`)
                      }
                      
                      console.log(addHost(data.Description, 'https://images.example.com'))
                      let data = {
                        "Subscription": "standard",
                        "_id": "610bc1265aeb5e38e42c8220",
                        "Headline": "How to stop screwing yourself over",
                        "Description": "<p>How do you get on the road to being happier? Start by setting your alarm for 30 minutes earlier than usual and not hitting the snooze button. The effort required to leave that warm bed and enter the world is the same amount of effort needed to shake up your life and make that elusive change. In this humorous and provocative talk, Mel Robbins explains how turning off our brain's autopilot and demolishing our comfort zones is key to a rewarding life.</p><p><img src=\"/uploads/photo_1483985988355_763728e1935b_ixid_Mnwx_Mj_A3f_DB_8_M_Hxz_ZW_Fy_Y2h8_M_Xx8_Zm_Fza_Glvbnxlbnwwf_Hwwf_Hw_3_D_and_ixlib_rb_1_2_5186b4137a.1&amp;w=1000&amp;q=80\" alt=\"\"></p><p>Yet another image for fun <img src=\"/uploads/photo_1483985988355_763728e1935b_ixid_Mnwx_Mj_A3f_DB_8_M_Hxz_ZW_Fy_Y2h8_M_Xx8_Zm_Fza_Glvbnxlbnwwf_Hwwf_Hw_3_D_and_ixlib_rb_1_2_5186b4137a.1&amp;w=1000&amp;q=80\" alt=\"\"></p>",
                        "published_at": "2021-08-05T13:06:47.325Z"
                      }
                      
                      function addHost(str, host) {
                        return str.split('src=\"/uploads').join(`src=\"${host}/uploads`)
                      }
                      
                      console.log(addHost(data.Description, 'https://images.example.com'))

                      Create Strapi App, no option for mongoDB on custom installation type

                      copy iconCopydownload iconDownload
                      npx create-strapi-app@3.6.8 fileName
                      
                      

                      Components not included in Strapi api response

                      copy iconCopydownload iconDownload
                      http://localhost:1337/api/test?populate=*
                      
                      http://localhost:1337/api/test?populate[TestExamples][populate]=*
                      
                      http://localhost:1337/api/test?populate=*
                      
                      http://localhost:1337/api/test?populate[TestExamples][populate]=*
                      
                      const { createCoreController } = require('@strapi/strapi').factories;
                      
                      module.exports = createCoreController('api::homepage.homepage', ({ strapi }) => ({
                          async find(ctx) {
                              const populateList = [
                                  'Header.header_image',
                                  'Header.buttons',
                                  'Clients.clients'
                              ]
                              // Push any additional query params to the array
                              populateList.push(ctx.query.populate)
                              ctx.query.populate = populateList.join(',')
                      
                              const content = await super.find(ctx)
                              return content
                          }
                      }));
                      
                      class DeepQuery {
                        constructor(public query: any) {
                      
                        }
                      
                        private isObj(obj: any): boolean {
                          return (
                            typeof obj === 'object' &&
                            obj !== null
                          )
                        }
                      
                        private toQPK(crumbs: string[]): string {
                          if (crumbs.length == 0) {
                            throw new Error(`Parameter without key`)
                          }
                          return crumbs[0] + crumbs.slice(1).map(s => `[${s}]`).join("");
                        }
                      
                        private parse(obj: any, crumbs: string[] = [], memo: {[key: string]: any} = {}) {
                          if (!this.isObj(obj)) {
                            memo[this.toQPK(crumbs)] = obj;
                          } else if (Array.isArray(obj)) {
                            for (let i = 0; i < obj.length; i++) {
                              crumbs.push(i.toString());
                              this.parse(obj[i], crumbs, memo);
                              crumbs.pop();
                            }
                          } else {
                            for (let key in obj) {
                              if (obj.hasOwnProperty(key)) {
                                crumbs.push(key);
                                this.parse(obj[key], crumbs, memo)
                                crumbs.pop();
                              }
                            }
                          }
                          return memo;
                        }
                      
                        public encode() {
                          return this.parse(this.query);
                        }
                      }
                      
                      makeCall(type: string): Observable<any> {
                          let populate = {
                              authors: ["listing", "publisher"]
                          };
                          let params = new DeepQuery({populate});
                          return this.html.get<any>(url.href, params.encode());
                        }
                      
                      class DeepQuery {
                        constructor(public query: any) {
                      
                        }
                      
                        private isObj(obj: any): boolean {
                          return (
                            typeof obj === 'object' &&
                            obj !== null
                          )
                        }
                      
                        private toQPK(crumbs: string[]): string {
                          if (crumbs.length == 0) {
                            throw new Error(`Parameter without key`)
                          }
                          return crumbs[0] + crumbs.slice(1).map(s => `[${s}]`).join("");
                        }
                      
                        private parse(obj: any, crumbs: string[] = [], memo: {[key: string]: any} = {}) {
                          if (!this.isObj(obj)) {
                            memo[this.toQPK(crumbs)] = obj;
                          } else if (Array.isArray(obj)) {
                            for (let i = 0; i < obj.length; i++) {
                              crumbs.push(i.toString());
                              this.parse(obj[i], crumbs, memo);
                              crumbs.pop();
                            }
                          } else {
                            for (let key in obj) {
                              if (obj.hasOwnProperty(key)) {
                                crumbs.push(key);
                                this.parse(obj[key], crumbs, memo)
                                crumbs.pop();
                              }
                            }
                          }
                          return memo;
                        }
                      
                        public encode() {
                          return this.parse(this.query);
                        }
                      }
                      
                      makeCall(type: string): Observable<any> {
                          let populate = {
                              authors: ["listing", "publisher"]
                          };
                          let params = new DeepQuery({populate});
                          return this.html.get<any>(url.href, params.encode());
                        }
                      
                      {
                        resolve: "gatsby-source-strapi",
                        options: {
                          apiURL:
                            process.env.NODE_ENV === "production"
                              ? process.env.API_URL
                              : "http://localhost:1337/api",
                          accessToken: process.env.STRAPI_TOKEN,
                          collectionTypes: [
                            { name: `descrizioni-home-page` },
                            { name: "article", endpoint: "articles?populate=*" },
                          ],
                          singleTypes: [{ name: "homepage", endpoint: "homepage?populate=*" }],
                          queryLimit: 5000,
                        },
                      },
                      

                      Strapi POST api for content-type with relational fields

                      copy iconCopydownload iconDownload
                          await axios.post(
                            `${baseUrl}/api/orders`,
                            {
                              data: {
                                products: [9],
                                total: 320,
                                user: 42
                              }
                            }
                          );
                      

                      Error: Must use import to load ES Module: D:\node_modules\react-markdown\index.js require() of ES modules is not supported

                      copy iconCopydownload iconDownload
                      {
                        "name": "passportlegacy",
                        "version": "0.1.0",
                        "type": "module",
                        "private": true,
                        "scripts": {
                          ...
                        }
                        ...
                      }
                      
                      "dependencies": {
                          "react-markdown": "^6.0.0"
                        }
                      
                      npm install 
                      
                      "dependencies": {
                          "react-markdown": "^6.0.0"
                        }
                      
                      npm install 
                      

                      Strapi v4 sanitizeEntity

                      copy iconCopydownload iconDownload
                      const { sanitize } = require('@strapi/utils');
                      
                      module.exports = createCoreController('api::payment.payment', ({ strapi }) => ({
                        async create(ctx) {
                          const entity = await strapi.entityService.create('api::payment.payment', {
                            data: {
                              field1: 1,
                              field2: 2,
                            },
                          });
                          const sanitizedEntity = await sanitize.contentAPI.output(entity);
                      
                          return { data: sanitizedEntity };
                        },
                      }));
                      
                      
                      const { sanitizeEntity } = require('strapi-utils/lib');
                      
                      currentUser: async (ctx, next) => {
                          const {id, isAdmin = false} = await strapi.plugins['users-permissions'].services.jwt.getToken(ctx); 
                          const entity = await strapi.entityService.findOne('plugin::users-permissions.user', id); // or get the user differently, in this case I can't take it from context
                      
                          let sanitizedEntity = sanitizeEntity(entity, { model: strapi.getModel('plugin::users-permissions.user') });
                          return sanitizedEntity;
                        }
                      
                      **const { sanitizeEntity } = require("strapi-utils/lib");**
                      
                      module.exports = (plugin) => {
                      
                        plugin.controllers.user.deleteMe = async (ctx) => {
                          const entity = await strapi.entityService.delete('plugin::users-permissions.user', user.id)
                          var result = **sanitizeEntity(entity, { model: strapi.getModel('plugin::users-permissions.user') })**
                          return result
                        };
                      //...
                      };
                      

                      How to add unit testing in strapi version 4 using jest?

                      copy iconCopydownload iconDownload
                      await instance.server.mount();
                      
                      await instance.app
                             .use(instance.router.routes()) // populate KOA routes
                             .use(instance.router.allowedMethods()); // populate KOA methods
                      instance.server = http.createServer(instance.app.callback());
                      
                       strapi.server.httpServer
                      
                       strapi.server
                      
                       yarn add --dev jest supertest sqlite3
                      
                       npm install --save-dev jest supertest sqlite3
                      
                      "scripts": {
                         // ...strapi scripts
                        "test": "jest --forceExit --detectOpenHandles", //add
                        "watch": "yarn test --watch", // optional
                      }
                      
                      module.exports = {
                          verbose: true,
                          testPathIgnorePatterns: [
                              "/node_modules/",
                              ".tmp",
                              ".cache"
                          ],
                          modulePaths: [
                              "/node_modules/",
                          ],
                          testEnvironment: "node",
                      };
                      
                      {
                          "connection": {
                              "client": "sqlite",
                              "connection": {
                                  "filename": ".tmp/test.db"
                              },
                              "useNullAsDefault": true,
                              "pool": {
                                  "min": 0,
                                  "max": 1
                              }
                          }
                      }
                      
                      const Strapi = require("@strapi/strapi");
                      const fs = require("fs");
                      
                      let instance;
                      
                      async function setupStrapi() {
                        if (!instance) {
                          await Strapi().load();
                          instance = strapi;
                          await instance.server.mount();
                        }
                        return instance;
                      }
                      
                      async function cleanupStrapi() {
                        const dbSettings = strapi.config.get("database.connection");
                        const tmpDbFile = dbSettings.connection.filename
                      
                        //close server to release the db-file
                        await strapi.server.httpServer.close();
                      
                        //delete test database after all tests
                        if (dbSettings && tmpDbFile) {
                          if (fs.existsSync(tmpDbFile)) {
                            fs.unlinkSync(tmpDbFile);
                          }
                        }
                        // close the connection to the database
                        await strapi.db.connection.destroy();
                      }
                      
                      module.exports = { setupStrapi, cleanupStrapi };
                      
                      const { setupStrapi, cleanupStrapi } = require("./helpers/strapi");
                      
                      jest.setTimeout(15000);
                      
                      beforeAll(async () => {
                        await setupStrapi(); 
                      });
                      
                      afterAll(async () => {
                       await cleanupStrapi();
                      });
                      
                      it("strapi is defined", () => {
                        expect(strapi).toBeDefined();
                      });
                      
                      require('./hello')
                      
                      const request = require('supertest');
                      
                      it('should return hello world', async () => {
                        await request(strapi.server.httpServer) 
                          .get('/api/hello')
                          .expect(200) // Expect response http code 200
                      });
                      
                      await instance.server.mount();
                      
                      await instance.app
                             .use(instance.router.routes()) // populate KOA routes
                             .use(instance.router.allowedMethods()); // populate KOA methods
                      instance.server = http.createServer(instance.app.callback());
                      
                       strapi.server.httpServer
                      
                       strapi.server
                      
                       yarn add --dev jest supertest sqlite3
                      
                       npm install --save-dev jest supertest sqlite3
                      
                      "scripts": {
                         // ...strapi scripts
                        "test": "jest --forceExit --detectOpenHandles", //add
                        "watch": "yarn test --watch", // optional
                      }
                      
                      module.exports = {
                          verbose: true,
                          testPathIgnorePatterns: [
                              "/node_modules/",
                              ".tmp",
                              ".cache"
                          ],
                          modulePaths: [
                              "/node_modules/",
                          ],
                          testEnvironment: "node",
                      };
                      
                      {
                          "connection": {
                              "client": "sqlite",
                              "connection": {
                                  "filename": ".tmp/test.db"
                              },
                              "useNullAsDefault": true,
                              "pool": {
                                  "min": 0,
                                  "max": 1
                              }
                          }
                      }
                      
                      const Strapi = require("@strapi/strapi");
                      const fs = require("fs");
                      
                      let instance;
                      
                      async function setupStrapi() {
                        if (!instance) {
                          await Strapi().load();
                          instance = strapi;
                          await instance.server.mount();
                        }
                        return instance;
                      }
                      
                      async function cleanupStrapi() {
                        const dbSettings = strapi.config.get("database.connection");
                        const tmpDbFile = dbSettings.connection.filename
                      
                        //close server to release the db-file
                        await strapi.server.httpServer.close();
                      
                        //delete test database after all tests
                        if (dbSettings && tmpDbFile) {
                          if (fs.existsSync(tmpDbFile)) {
                            fs.unlinkSync(tmpDbFile);
                          }
                        }
                        // close the connection to the database
                        await strapi.db.connection.destroy();
                      }
                      
                      module.exports = { setupStrapi, cleanupStrapi };
                      
                      const { setupStrapi, cleanupStrapi } = require("./helpers/strapi");
                      
                      jest.setTimeout(15000);
                      
                      beforeAll(async () => {
                        await setupStrapi(); 
                      });
                      
                      afterAll(async () => {
                       await cleanupStrapi();
                      });
                      
                      it("strapi is defined", () => {
                        expect(strapi).toBeDefined();
                      });
                      
                      require('./hello')
                      
                      const request = require('supertest');
                      
                      it('should return hello world', async () => {
                        await request(strapi.server.httpServer) 
                          .get('/api/hello')
                          .expect(200) // Expect response http code 200
                      });
                      
                      await instance.server.mount();
                      
                      await instance.app
                             .use(instance.router.routes()) // populate KOA routes
                             .use(instance.router.allowedMethods()); // populate KOA methods
                      instance.server = http.createServer(instance.app.callback());
                      
                       strapi.server.httpServer
                      
                       strapi.server
                      
                       yarn add --dev jest supertest sqlite3
                      
                       npm install --save-dev jest supertest sqlite3
                      
                      "scripts": {
                         // ...strapi scripts
                        "test": "jest --forceExit --detectOpenHandles", //add
                        "watch": "yarn test --watch", // optional
                      }
                      
                      module.exports = {
                          verbose: true,
                          testPathIgnorePatterns: [
                              "/node_modules/",
                              ".tmp",
                              ".cache"
                          ],
                          modulePaths: [
                              "/node_modules/",
                          ],
                          testEnvironment: "node",
                      };
                      
                      {
                          "connection": {
                              "client": "sqlite",
                              "connection": {
                                  "filename": ".tmp/test.db"
                              },
                              "useNullAsDefault": true,
                              "pool": {
                                  "min": 0,
                                  "max": 1
                              }
                          }
                      }
                      
                      const Strapi = require("@strapi/strapi");
                      const fs = require("fs");
                      
                      let instance;
                      
                      async function setupStrapi() {
                        if (!instance) {
                          await Strapi().load();
                          instance = strapi;
                          await instance.server.mount();
                        }
                        return instance;
                      }
                      
                      async function cleanupStrapi() {
                        const dbSettings = strapi.config.get("database.connection");
                        const tmpDbFile = dbSettings.connection.filename
                      
                        //close server to release the db-file
                        await strapi.server.httpServer.close();
                      
                        //delete test database after all tests
                        if (dbSettings && tmpDbFile) {
                          if (fs.existsSync(tmpDbFile)) {
                            fs.unlinkSync(tmpDbFile);
                          }
                        }
                        // close the connection to the database
                        await strapi.db.connection.destroy();
                      }
                      
                      module.exports = { setupStrapi, cleanupStrapi };
                      
                      const { setupStrapi, cleanupStrapi } = require("./helpers/strapi");
                      
                      jest.setTimeout(15000);
                      
                      beforeAll(async () => {
                        await setupStrapi(); 
                      });
                      
                      afterAll(async () => {
                       await cleanupStrapi();
                      });
                      
                      it("strapi is defined", () => {
                        expect(strapi).toBeDefined();
                      });
                      
                      require('./hello')
                      
                      const request = require('supertest');
                      
                      it('should return hello world', async () => {
                        await request(strapi.server.httpServer) 
                          .get('/api/hello')
                          .expect(200) // Expect response http code 200
                      });
                      
                      await instance.server.mount();
                      
                      await instance.app
                             .use(instance.router.routes()) // populate KOA routes
                             .use(instance.router.allowedMethods()); // populate KOA methods
                      instance.server = http.createServer(instance.app.callback());
                      
                       strapi.server.httpServer
                      
                       strapi.server
                      
                       yarn add --dev jest supertest sqlite3
                      
                       npm install --save-dev jest supertest sqlite3
                      
                      "scripts": {
                         // ...strapi scripts
                        "test": "jest --forceExit --detectOpenHandles", //add
                        "watch": "yarn test --watch", // optional
                      }
                      
                      module.exports = {
                          verbose: true,
                          testPathIgnorePatterns: [
                              "/node_modules/",
                              ".tmp",
                              ".cache"
                          ],
                          modulePaths: [
                              "/node_modules/",
                          ],
                          testEnvironment: "node",
                      };
                      
                      {
                          "connection": {
                              "client": "sqlite",
                              "connection": {
                                  "filename": ".tmp/test.db"
                              },
                              "useNullAsDefault": true,
                              "pool": {
                                  "min": 0,
                                  "max": 1
                              }
                          }
                      }
                      
                      const Strapi = require("@strapi/strapi");
                      const fs = require("fs");
                      
                      let instance;
                      
                      async function setupStrapi() {
                        if (!instance) {
                          await Strapi().load();
                          instance = strapi;
                          await instance.server.mount();
                        }
                        return instance;
                      }
                      
                      async function cleanupStrapi() {
                        const dbSettings = strapi.config.get("database.connection");
                        const tmpDbFile = dbSettings.connection.filename
                      
                        //close server to release the db-file
                        await strapi.server.httpServer.close();
                      
                        //delete test database after all tests
                        if (dbSettings && tmpDbFile) {
                          if (fs.existsSync(tmpDbFile)) {
                            fs.unlinkSync(tmpDbFile);
                          }
                        }
                        // close the connection to the database
                        await strapi.db.connection.destroy();
                      }
                      
                      module.exports = { setupStrapi, cleanupStrapi };
                      
                      const { setupStrapi, cleanupStrapi } = require("./helpers/strapi");
                      
                      jest.setTimeout(15000);
                      
                      beforeAll(async () => {
                        await setupStrapi(); 
                      });
                      
                      afterAll(async () => {
                       await cleanupStrapi();
                      });
                      
                      it("strapi is defined", () => {
                        expect(strapi).toBeDefined();
                      });
                      
                      require('./hello')
                      
                      const request = require('supertest');
                      
                      it('should return hello world', async () => {
                        await request(strapi.server.httpServer) 
                          .get('/api/hello')
                          .expect(200) // Expect response http code 200
                      });
                      
                      await instance.server.mount();
                      
                      await instance.app
                             .use(instance.router.routes()) // populate KOA routes
                             .use(instance.router.allowedMethods()); // populate KOA methods
                      instance.server = http.createServer(instance.app.callback());
                      
                       strapi.server.httpServer
                      
                       strapi.server
                      
                       yarn add --dev jest supertest sqlite3
                      
                       npm install --save-dev jest supertest sqlite3
                      
                      "scripts": {
                         // ...strapi scripts
                        "test": "jest --forceExit --detectOpenHandles", //add
                        "watch": "yarn test --watch", // optional
                      }
                      
                      module.exports = {
                          verbose: true,
                          testPathIgnorePatterns: [
                              "/node_modules/",
                              ".tmp",
                              ".cache"
                          ],
                          modulePaths: [
                              "/node_modules/",
                          ],
                          testEnvironment: "node",
                      };
                      
                      {
                          "connection": {
                              "client": "sqlite",
                              "connection": {
                                  "filename": ".tmp/test.db"
                              },
                              "useNullAsDefault": true,
                              "pool": {
                                  "min": 0,
                                  "max": 1
                              }
                          }
                      }
                      
                      const Strapi = require("@strapi/strapi");
                      const fs = require("fs");
                      
                      let instance;
                      
                      async function setupStrapi() {
                        if (!instance) {
                          await Strapi().load();
                          instance = strapi;
                          await instance.server.mount();
                        }
                        return instance;
                      }
                      
                      async function cleanupStrapi() {
                        const dbSettings = strapi.config.get("database.connection");
                        const tmpDbFile = dbSettings.connection.filename
                      
                        //close server to release the db-file
                        await strapi.server.httpServer.close();
                      
                        //delete test database after all tests
                        if (dbSettings && tmpDbFile) {
                          if (fs.existsSync(tmpDbFile)) {
                            fs.unlinkSync(tmpDbFile);
                          }
                        }
                        // close the connection to the database
                        await strapi.db.connection.destroy();
                      }
                      
                      module.exports = { setupStrapi, cleanupStrapi };
                      
                      const { setupStrapi, cleanupStrapi } = require("./helpers/strapi");
                      
                      jest.setTimeout(15000);
                      
                      beforeAll(async () => {
                        await setupStrapi(); 
                      });
                      
                      afterAll(async () => {
                       await cleanupStrapi();
                      });
                      
                      it("strapi is defined", () => {
                        expect(strapi).toBeDefined();
                      });
                      
                      require('./hello')
                      
                      const request = require('supertest');
                      
                      it('should return hello world', async () => {
                        await request(strapi.server.httpServer) 
                          .get('/api/hello')
                          .expect(200) // Expect response http code 200
                      });
                      
                      await instance.server.mount();
                      
                      await instance.app
                             .use(instance.router.routes()) // populate KOA routes
                             .use(instance.router.allowedMethods()); // populate KOA methods
                      instance.server = http.createServer(instance.app.callback());
                      
                       strapi.server.httpServer
                      
                       strapi.server
                      
                       yarn add --dev jest supertest sqlite3
                      
                       npm install --save-dev jest supertest sqlite3
                      
                      "scripts": {
                         // ...strapi scripts
                        "test": "jest --forceExit --detectOpenHandles", //add
                        "watch": "yarn test --watch", // optional
                      }
                      
                      module.exports = {
                          verbose: true,
                          testPathIgnorePatterns: [
                              "/node_modules/",
                              ".tmp",
                              ".cache"
                          ],
                          modulePaths: [
                              "/node_modules/",
                          ],
                          testEnvironment: "node",
                      };
                      
                      {
                          "connection": {
                              "client": "sqlite",
                              "connection": {
                                  "filename": ".tmp/test.db"
                              },
                              "useNullAsDefault": true,
                              "pool": {
                                  "min": 0,
                                  "max": 1
                              }
                          }
                      }
                      
                      const Strapi = require("@strapi/strapi");
                      const fs = require("fs");
                      
                      let instance;
                      
                      async function setupStrapi() {
                        if (!instance) {
                          await Strapi().load();
                          instance = strapi;
                          await instance.server.mount();
                        }
                        return instance;
                      }
                      
                      async function cleanupStrapi() {
                        const dbSettings = strapi.config.get("database.connection");
                        const tmpDbFile = dbSettings.connection.filename
                      
                        //close server to release the db-file
                        await strapi.server.httpServer.close();
                      
                        //delete test database after all tests
                        if (dbSettings && tmpDbFile) {
                          if (fs.existsSync(tmpDbFile)) {
                            fs.unlinkSync(tmpDbFile);
                          }
                        }
                        // close the connection to the database
                        await strapi.db.connection.destroy();
                      }
                      
                      module.exports = { setupStrapi, cleanupStrapi };
                      
                      const { setupStrapi, cleanupStrapi } = require("./helpers/strapi");
                      
                      jest.setTimeout(15000);
                      
                      beforeAll(async () => {
                        await setupStrapi(); 
                      });
                      
                      afterAll(async () => {
                       await cleanupStrapi();
                      });
                      
                      it("strapi is defined", () => {
                        expect(strapi).toBeDefined();
                      });
                      
                      require('./hello')
                      
                      const request = require('supertest');
                      
                      it('should return hello world', async () => {
                        await request(strapi.server.httpServer) 
                          .get('/api/hello')
                          .expect(200) // Expect response http code 200
                      });
                      
                      await instance.server.mount();
                      
                      await instance.app
                             .use(instance.router.routes()) // populate KOA routes
                             .use(instance.router.allowedMethods()); // populate KOA methods
                      instance.server = http.createServer(instance.app.callback());
                      
                       strapi.server.httpServer
                      
                       strapi.server
                      
                       yarn add --dev jest supertest sqlite3
                      
                       npm install --save-dev jest supertest sqlite3
                      
                      "scripts": {
                         // ...strapi scripts
                        "test": "jest --forceExit --detectOpenHandles", //add
                        "watch": "yarn test --watch", // optional
                      }
                      
                      module.exports = {
                          verbose: true,
                          testPathIgnorePatterns: [
                              "/node_modules/",
                              ".tmp",
                              ".cache"
                          ],
                          modulePaths: [
                              "/node_modules/",
                          ],
                          testEnvironment: "node",
                      };
                      
                      {
                          "connection": {
                              "client": "sqlite",
                              "connection": {
                                  "filename": ".tmp/test.db"
                              },
                              "useNullAsDefault": true,
                              "pool": {
                                  "min": 0,
                                  "max": 1
                              }
                          }
                      }
                      
                      const Strapi = require("@strapi/strapi");
                      const fs = require("fs");
                      
                      let instance;
                      
                      async function setupStrapi() {
                        if (!instance) {
                          await Strapi().load();
                          instance = strapi;
                          await instance.server.mount();
                        }
                        return instance;
                      }
                      
                      async function cleanupStrapi() {
                        const dbSettings = strapi.config.get("database.connection");
                        const tmpDbFile = dbSettings.connection.filename
                      
                        //close server to release the db-file
                        await strapi.server.httpServer.close();
                      
                        //delete test database after all tests
                        if (dbSettings && tmpDbFile) {
                          if (fs.existsSync(tmpDbFile)) {
                            fs.unlinkSync(tmpDbFile);
                          }
                        }
                        // close the connection to the database
                        await strapi.db.connection.destroy();
                      }
                      
                      module.exports = { setupStrapi, cleanupStrapi };
                      
                      const { setupStrapi, cleanupStrapi } = require("./helpers/strapi");
                      
                      jest.setTimeout(15000);
                      
                      beforeAll(async () => {
                        await setupStrapi(); 
                      });
                      
                      afterAll(async () => {
                       await cleanupStrapi();
                      });
                      
                      it("strapi is defined", () => {
                        expect(strapi).toBeDefined();
                      });
                      
                      require('./hello')
                      
                      const request = require('supertest');
                      
                      it('should return hello world', async () => {
                        await request(strapi.server.httpServer) 
                          .get('/api/hello')
                          .expect(200) // Expect response http code 200
                      });
                      
                      await instance.server.mount();
                      
                      await instance.app
                             .use(instance.router.routes()) // populate KOA routes
                             .use(instance.router.allowedMethods()); // populate KOA methods
                      instance.server = http.createServer(instance.app.callback());
                      
                       strapi.server.httpServer
                      
                       strapi.server
                      
                       yarn add --dev jest supertest sqlite3
                      
                       npm install --save-dev jest supertest sqlite3
                      
                      "scripts": {
                         // ...strapi scripts
                        "test": "jest --forceExit --detectOpenHandles", //add
                        "watch": "yarn test --watch", // optional
                      }
                      
                      module.exports = {
                          verbose: true,
                          testPathIgnorePatterns: [
                              "/node_modules/",
                              ".tmp",
                              ".cache"
                          ],
                          modulePaths: [
                              "/node_modules/",
                          ],
                          testEnvironment: "node",
                      };
                      
                      {
                          "connection": {
                              "client": "sqlite",
                              "connection": {
                                  "filename": ".tmp/test.db"
                              },
                              "useNullAsDefault": true,
                              "pool": {
                                  "min": 0,
                                  "max": 1
                              }
                          }
                      }
                      
                      const Strapi = require("@strapi/strapi");
                      const fs = require("fs");
                      
                      let instance;
                      
                      async function setupStrapi() {
                        if (!instance) {
                          await Strapi().load();
                          instance = strapi;
                          await instance.server.mount();
                        }
                        return instance;
                      }
                      
                      async function cleanupStrapi() {
                        const dbSettings = strapi.config.get("database.connection");
                        const tmpDbFile = dbSettings.connection.filename
                      
                        //close server to release the db-file
                        await strapi.server.httpServer.close();
                      
                        //delete test database after all tests
                        if (dbSettings && tmpDbFile) {
                          if (fs.existsSync(tmpDbFile)) {
                            fs.unlinkSync(tmpDbFile);
                          }
                        }
                        // close the connection to the database
                        await strapi.db.connection.destroy();
                      }
                      
                      module.exports = { setupStrapi, cleanupStrapi };
                      
                      const { setupStrapi, cleanupStrapi } = require("./helpers/strapi");
                      
                      jest.setTimeout(15000);
                      
                      beforeAll(async () => {
                        await setupStrapi(); 
                      });
                      
                      afterAll(async () => {
                       await cleanupStrapi();
                      });
                      
                      it("strapi is defined", () => {
                        expect(strapi).toBeDefined();
                      });
                      
                      require('./hello')
                      
                      const request = require('supertest');
                      
                      it('should return hello world', async () => {
                        await request(strapi.server.httpServer) 
                          .get('/api/hello')
                          .expect(200) // Expect response http code 200
                      });
                      
                      await instance.server.mount();
                      
                      await instance.app
                             .use(instance.router.routes()) // populate KOA routes
                             .use(instance.router.allowedMethods()); // populate KOA methods
                      instance.server = http.createServer(instance.app.callback());
                      
                       strapi.server.httpServer
                      
                       strapi.server
                      
                       yarn add --dev jest supertest sqlite3
                      
                       npm install --save-dev jest supertest sqlite3
                      
                      "scripts": {
                         // ...strapi scripts
                        "test": "jest --forceExit --detectOpenHandles", //add
                        "watch": "yarn test --watch", // optional
                      }
                      
                      module.exports = {
                          verbose: true,
                          testPathIgnorePatterns: [
                              "/node_modules/",
                              ".tmp",
                              ".cache"
                          ],
                          modulePaths: [
                              "/node_modules/",
                          ],
                          testEnvironment: "node",
                      };
                      
                      {
                          "connection": {
                              "client": "sqlite",
                              "connection": {
                                  "filename": ".tmp/test.db"
                              },
                              "useNullAsDefault": true,
                              "pool": {
                                  "min": 0,
                                  "max": 1
                              }
                          }
                      }
                      
                      const Strapi = require("@strapi/strapi");
                      const fs = require("fs");
                      
                      let instance;
                      
                      async function setupStrapi() {
                        if (!instance) {
                          await Strapi().load();
                          instance = strapi;
                          await instance.server.mount();
                        }
                        return instance;
                      }
                      
                      async function cleanupStrapi() {
                        const dbSettings = strapi.config.get("database.connection");
                        const tmpDbFile = dbSettings.connection.filename
                      
                        //close server to release the db-file
                        await strapi.server.httpServer.close();
                      
                        //delete test database after all tests
                        if (dbSettings && tmpDbFile) {
                          if (fs.existsSync(tmpDbFile)) {
                            fs.unlinkSync(tmpDbFile);
                          }
                        }
                        // close the connection to the database
                        await strapi.db.connection.destroy();
                      }
                      
                      module.exports = { setupStrapi, cleanupStrapi };
                      
                      const { setupStrapi, cleanupStrapi } = require("./helpers/strapi");
                      
                      jest.setTimeout(15000);
                      
                      beforeAll(async () => {
                        await setupStrapi(); 
                      });
                      
                      afterAll(async () => {
                       await cleanupStrapi();
                      });
                      
                      it("strapi is defined", () => {
                        expect(strapi).toBeDefined();
                      });
                      
                      require('./hello')
                      
                      const request = require('supertest');
                      
                      it('should return hello world', async () => {
                        await request(strapi.server.httpServer) 
                          .get('/api/hello')
                          .expect(200) // Expect response http code 200
                      });
                      
                      await instance.server.mount();
                      
                      await instance.app
                             .use(instance.router.routes()) // populate KOA routes
                             .use(instance.router.allowedMethods()); // populate KOA methods
                      instance.server = http.createServer(instance.app.callback());
                      
                       strapi.server.httpServer
                      
                       strapi.server
                      
                       yarn add --dev jest supertest sqlite3
                      
                       npm install --save-dev jest supertest sqlite3
                      
                      "scripts": {
                         // ...strapi scripts
                        "test": "jest --forceExit --detectOpenHandles", //add
                        "watch": "yarn test --watch", // optional
                      }
                      
                      module.exports = {
                          verbose: true,
                          testPathIgnorePatterns: [
                              "/node_modules/",
                              ".tmp",
                              ".cache"
                          ],
                          modulePaths: [
                              "/node_modules/",
                          ],
                          testEnvironment: "node",
                      };
                      
                      {
                          "connection": {
                              "client": "sqlite",
                              "connection": {
                                  "filename": ".tmp/test.db"
                              },
                              "useNullAsDefault": true,
                              "pool": {
                                  "min": 0,
                                  "max": 1
                              }
                          }
                      }
                      
                      const Strapi = require("@strapi/strapi");
                      const fs = require("fs");
                      
                      let instance;
                      
                      async function setupStrapi() {
                        if (!instance) {
                          await Strapi().load();
                          instance = strapi;
                          await instance.server.mount();
                        }
                        return instance;
                      }
                      
                      async function cleanupStrapi() {
                        const dbSettings = strapi.config.get("database.connection");
                        const tmpDbFile = dbSettings.connection.filename
                      
                        //close server to release the db-file
                        await strapi.server.httpServer.close();
                      
                        //delete test database after all tests
                        if (dbSettings && tmpDbFile) {
                          if (fs.existsSync(tmpDbFile)) {
                            fs.unlinkSync(tmpDbFile);
                          }
                        }
                        // close the connection to the database
                        await strapi.db.connection.destroy();
                      }
                      
                      module.exports = { setupStrapi, cleanupStrapi };
                      
                      const { setupStrapi, cleanupStrapi } = require("./helpers/strapi");
                      
                      jest.setTimeout(15000);
                      
                      beforeAll(async () => {
                        await setupStrapi(); 
                      });
                      
                      afterAll(async () => {
                       await cleanupStrapi();
                      });
                      
                      it("strapi is defined", () => {
                        expect(strapi).toBeDefined();
                      });
                      
                      require('./hello')
                      
                      const request = require('supertest');
                      
                      it('should return hello world', async () => {
                        await request(strapi.server.httpServer) 
                          .get('/api/hello')
                          .expect(200) // Expect response http code 200
                      });
                      
                      await instance.server.mount();
                      
                      await instance.app
                             .use(instance.router.routes()) // populate KOA routes
                             .use(instance.router.allowedMethods()); // populate KOA methods
                      instance.server = http.createServer(instance.app.callback());
                      
                       strapi.server.httpServer
                      
                       strapi.server
                      
                       yarn add --dev jest supertest sqlite3
                      
                       npm install --save-dev jest supertest sqlite3
                      
                      "scripts": {
                         // ...strapi scripts
                        "test": "jest --forceExit --detectOpenHandles", //add
                        "watch": "yarn test --watch", // optional
                      }
                      
                      module.exports = {
                          verbose: true,
                          testPathIgnorePatterns: [
                              "/node_modules/",
                              ".tmp",
                              ".cache"
                          ],
                          modulePaths: [
                              "/node_modules/",
                          ],
                          testEnvironment: "node",
                      };
                      
                      {
                          "connection": {
                              "client": "sqlite",
                              "connection": {
                                  "filename": ".tmp/test.db"
                              },
                              "useNullAsDefault": true,
                              "pool": {
                                  "min": 0,
                                  "max": 1
                              }
                          }
                      }
                      
                      const Strapi = require("@strapi/strapi");
                      const fs = require("fs");
                      
                      let instance;
                      
                      async function setupStrapi() {
                        if (!instance) {
                          await Strapi().load();
                          instance = strapi;
                          await instance.server.mount();
                        }
                        return instance;
                      }
                      
                      async function cleanupStrapi() {
                        const dbSettings = strapi.config.get("database.connection");
                        const tmpDbFile = dbSettings.connection.filename
                      
                        //close server to release the db-file
                        await strapi.server.httpServer.close();
                      
                        //delete test database after all tests
                        if (dbSettings && tmpDbFile) {
                          if (fs.existsSync(tmpDbFile)) {
                            fs.unlinkSync(tmpDbFile);
                          }
                        }
                        // close the connection to the database
                        await strapi.db.connection.destroy();
                      }
                      
                      module.exports = { setupStrapi, cleanupStrapi };
                      
                      const { setupStrapi, cleanupStrapi } = require("./helpers/strapi");
                      
                      jest.setTimeout(15000);
                      
                      beforeAll(async () => {
                        await setupStrapi(); 
                      });
                      
                      afterAll(async () => {
                       await cleanupStrapi();
                      });
                      
                      it("strapi is defined", () => {
                        expect(strapi).toBeDefined();
                      });
                      
                      require('./hello')
                      
                      const request = require('supertest');
                      
                      it('should return hello world', async () => {
                        await request(strapi.server.httpServer) 
                          .get('/api/hello')
                          .expect(200) // Expect response http code 200
                      });
                      
                      await instance.server.mount();
                      
                      await instance.app
                             .use(instance.router.routes()) // populate KOA routes
                             .use(instance.router.allowedMethods()); // populate KOA methods
                      instance.server = http.createServer(instance.app.callback());
                      
                       strapi.server.httpServer
                      
                       strapi.server
                      
                       yarn add --dev jest supertest sqlite3
                      
                       npm install --save-dev jest supertest sqlite3
                      
                      "scripts": {
                         // ...strapi scripts
                        "test": "jest --forceExit --detectOpenHandles", //add
                        "watch": "yarn test --watch", // optional
                      }
                      
                      module.exports = {
                          verbose: true,
                          testPathIgnorePatterns: [
                              "/node_modules/",
                              ".tmp",
                              ".cache"
                          ],
                          modulePaths: [
                              "/node_modules/",
                          ],
                          testEnvironment: "node",
                      };
                      
                      {
                          "connection": {
                              "client": "sqlite",
                              "connection": {
                                  "filename": ".tmp/test.db"
                              },
                              "useNullAsDefault": true,
                              "pool": {
                                  "min": 0,
                                  "max": 1
                              }
                          }
                      }
                      
                      const Strapi = require("@strapi/strapi");
                      const fs = require("fs");
                      
                      let instance;
                      
                      async function setupStrapi() {
                        if (!instance) {
                          await Strapi().load();
                          instance = strapi;
                          await instance.server.mount();
                        }
                        return instance;
                      }
                      
                      async function cleanupStrapi() {
                        const dbSettings = strapi.config.get("database.connection");
                        const tmpDbFile = dbSettings.connection.filename
                      
                        //close server to release the db-file
                        await strapi.server.httpServer.close();
                      
                        //delete test database after all tests
                        if (dbSettings && tmpDbFile) {
                          if (fs.existsSync(tmpDbFile)) {
                            fs.unlinkSync(tmpDbFile);
                          }
                        }
                        // close the connection to the database
                        await strapi.db.connection.destroy();
                      }
                      
                      module.exports = { setupStrapi, cleanupStrapi };
                      
                      const { setupStrapi, cleanupStrapi } = require("./helpers/strapi");
                      
                      jest.setTimeout(15000);
                      
                      beforeAll(async () => {
                        await setupStrapi(); 
                      });
                      
                      afterAll(async () => {
                       await cleanupStrapi();
                      });
                      
                      it("strapi is defined", () => {
                        expect(strapi).toBeDefined();
                      });
                      
                      require('./hello')
                      
                      const request = require('supertest');
                      
                      it('should return hello world', async () => {
                        await request(strapi.server.httpServer) 
                          .get('/api/hello')
                          .expect(200) // Expect response http code 200
                      });
                      

                      Showing attributes of an object with Svelte and Strapi v4

                      copy iconCopydownload iconDownload
                      <script>
                        import { onMount } from "svelte";
                      
                        let produits = [];
                      
                        onMount(async () => {
                          const response = await fetch("http://localhost:1337/api/produits");
                          produits = await response.json();
                          console.log(produits);
                        });
                      </script>
                      
                      {#if produits.data}
                        {#each produits.data as produit}
                          <h3>{produit.id}{produit.attributes.reference}</h3> <!-- modified this line -->
                          ///how to enter into the attributes with Strapi v4 ?///
                          <hr />
                        {:else}
                          <p>Chargement...</p>
                        {/each}
                      {/if}
                      
                      

                      Wrong og:image is appearing on page metadata

                      copy iconCopydownload iconDownload
                      <link rel="canonical" href="https://poomgo.com/" />
                      

                      See all related Code Snippets

                      Community Discussions

                      Trending Discussions on strapi
                      • &quot;gatsby develop&quot; cannot run in Mac M1
                      • Changing image source property of a child with dangerously set innerhtml parent attribute in React
                      • Create Strapi App, no option for mongoDB on custom installation type
                      • Strapi new user registration keeps getting &quot;Email is already taken&quot; error, no email confirmation either
                      • Components not included in Strapi api response
                      • strapi v4 with postgres error, database does not exist
                      • New Strapi Application won’t run
                      • Strapi POST api for content-type with relational fields
                      • Error: Must use import to load ES Module: D:\node_modules\react-markdown\index.js require() of ES modules is not supported
                      • Strapi v4 sanitizeEntity
                      Trending Discussions on strapi

                      QUESTION

                      &quot;gatsby develop&quot; cannot run in Mac M1

                      Asked 2022-Apr-15 at 09:41

                      Iam using gatsby 3.1.2 version with strapi as CMS, were i could not able to run gatsby develop and it is throwing this below mentioned error. Also attached the screenshot from terminal.

                      ERROR 
                      
                      Invalid options object. Ignore Plugin has been initialized using an options object that does not match the API schema.
                       - options should be one of these:
                         object { resourceRegExp, contextRegExp? } | object { checkResource }
                         Details:
                          * options misses the property 'resourceRegExp'. Should be:
                            RegExp
                            -> A RegExp to test the request against.
                          * options misses the property 'checkResource'. Should be:
                            function
                            -> A filter function for resource and context.
                      

                      enter image description here

                      System Informations:

                      • Gatsby CLI version: 4.0.0
                      • Gatsby version: 3.14.6
                      • Node version: v14.18.0
                      • NPM version: 6.14.15

                      ANSWER

                      Answered 2022-Apr-15 at 09:39

                      In case it helps anyone, prior to this error (where it just doesn't run, without throwing any errors or clues) I had a hard time with npm install, but I was able to fix that by running the following:

                      brew reinstall vips
                      xcode-select --install
                      brew install gcc
                      brew reinstall vips
                      brew info vips
                      npm i
                      

                      Source https://stackoverflow.com/questions/71882392

                      Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                      Vulnerabilities

                      No vulnerabilities reported

                      Install strapi

                      Read the Getting Started tutorial or follow the steps below:.
                      Install Strapi with this Quickstart command to create a Strapi project instantly:. This command generates a brand new project with the default features (authentication, permissions, content management, content type builder & file upload). The Quickstart command installs Strapi using a SQLite database which is used for prototyping in development.
                      (Use yarn to install the Strapi project (recommended). Install yarn with these docs.)
                      (Use npm/npx to install the Strapi project.)

                      Support

                      Please read our Contributing Guide before submitting a Pull Request to the project.

                      DOWNLOAD this Library from

                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      Share this Page

                      share link
                      Reuse Pre-built Kits with strapi
                      Consider Popular Content Management System Libraries
                      Try Top Libraries by strapi
                      Compare Content Management System Libraries with Highest Support
                      Compare Content Management System Libraries with Highest Quality
                      Compare Content Management System Libraries with Highest Security
                      Compare Content Management System Libraries with Permissive License
                      Compare Content Management System Libraries with Highest Reuse
                      Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
                      over 430 million Knowledge Items
                      Find more libraries
                      Reuse Solution Kits and Libraries Curated by Popular Use Cases
                      Explore Kits

                      Save this library and start creating your kit

                      • © 2022 Open Weaver Inc.