strapi

Gatsby JS: Preloader is loading forever

女生的网名这么多〃 提交于 2021-02-19 08:43:10
问题 I copied a simple full page preloader via jQuery on my Gatsby app. The preloader works however instead of disappearing after 4 seconds its loading forever on production but on local it works just fine. Here's my Preloader component: import React from 'react' const Preloader = () => { return ( <div id="loader-wrapper"> <div id="loader"></div> <div className="loader-section section-left"></div> <div className="loader-section section-right"></div> </div> ) } export default Preloader And then on

Strapi is not loading the Collections from existing MongoDB hosted on Digital Ocean

让人想犯罪 __ 提交于 2021-02-19 01:24:39
问题 I am creating a New Application using Strapi and I have tried to connect it with my MongoDB which is hosted on Digital Ocean but unfortunately Strapi is not able to fetch the collections from existing MongoDB . Here, I am mentioning the complete steps that I have followed to achieve the connection of Strapi with the existing MongoDB: I have followed this guide step by step to create a Strapi Application: Quick_Start_Strapi Although, I need to connect to my existing MongoDB which is hosted on

Can I create multiple elements of the same type using Strapi and GraphQL?

南笙酒味 提交于 2021-02-11 12:23:08
问题 Can I create multiple elements of the same type using Strapi and GraphQL? For example - createMultipleFoo mutation(data: [ nameOfFoo: "ooaoaoa", weightOfFoo: "aododo" ], ....) 回答1: It's in the roadmap. What you can do for now is create a custom endpoint ie. "createMulti". Send a json array, and use the "regular" create for each. Check out the discussion here. Any questions post a comment 来源: https://stackoverflow.com/questions/63260467/can-i-create-multiple-elements-of-the-same-type-using

Cannot run Strapi with Docker

混江龙づ霸主 提交于 2021-02-07 19:51:21
问题 I'm trying to Dockerize my Strapi application, so first all in the root directory of the project I have created an .env file which contains the following: HOST=0.0.0.0 PORT=3002 then, inside backend/config/server.js I have: module.exports = ({ env }) => ({ host: env("HOST", "0.0.0.0"), port: env.int("PORT"), admin: { auth: { secret: env("ADMIN_JWT_SECRET", "3b8efb990e54568fc0d91ff31390cda7"), }, }, }); this code is supposed to bind the application to 0.0.0.0 . Infact, when I run the container

How to query multiple images in Gatsby from Strapi using Graphql

旧街凉风 提交于 2021-02-04 08:10:30
问题 I have set up a multiple media(images) field called pictures on my project content type on Strapi and I have added 2 projects with pictures containing 4 images each. I want to query these images in Gatsby using Graphql. This is my plugins array in gatsby-config.js plugins: [ `gatsby-plugin-react-helmet`, { resolve: `gatsby-source-filesystem`, options: { name: `images`, path: `${__dirname}/src/images`, }, }, `gatsby-plugin-sharp`, `gatsby-transformer-sharp`, { resolve: `gatsby-plugin-manifest`

Bookshelf.js - Nested relations while querying with andWhere()

99封情书 提交于 2021-01-29 11:11:35
问题 I'm using the strapi framework based on node.js and while creating a query-builder, I'm facing an issue with the andWhere() clause. I am implementing search functionality where a user can input some text in a form input field, which gets passed in, and database table fields are queried based on that text . In the code below, you can see that I query for two things: Search the product model wherever the text is present in the name field. And always check and search the product model wherever

Check Password in ContentType Controller

纵饮孤独 提交于 2021-01-29 09:23:54
问题 I want a user to enter his password again if he wants to edit some important data, i. e. after he is already logged in. How can I check his password in the Controller of a ContentType? Thanks a lot! P.S. I would like a method like checkPassword(pwd){...} : var queryEdit.description = ctx.request.body.description; var pwd = ctx.request.body.password; delete ctx.request.body.password; if (checkPassword(pwd) === true) { let obj = await strapi.services.key.edit(ctx.params, queryEdit); } 来源: https

Is there any way to disable a admin page in starpi?

做~自己de王妃 提交于 2021-01-29 05:38:25
问题 I am using strapi framework in one of my project. After development, I need to disable the admin dashboard ('/admin' route). I found the ways to change the URL, but not to disable. How can i do this? 回答1: There is no option to disable the admin in production. You can rename the admin folder with _admin (or delete the folder) Update the plugin/users-permissions/middlewares/users-permissions/index.js file and comment these lines: // _.forEach(strapi.admin.config.routes, value => { // if (_.get

How to delete file from upload folder in strapi?

人盡茶涼 提交于 2021-01-28 06:11:10
问题 I have an entry with field of type media. When I'm trying to delete some entry, I'm using code: strapi.query('entry').delete({ id: entry.id }); strapi.query('file', 'upload').delete({ id: entry.image.id }); The entry is deleted successfully, as well as record from "Files Upload". But file still stays in upload folder. How can I delete it? 回答1: This code removes entry from Media Library and deletes files from uploads directory: const file = await strapi.plugins['upload'].services.upload.fetch(

Elastic Search: One index with custom type to differentiate document schemas VS multiple index, one per document type?

本小妞迷上赌 提交于 2021-01-27 12:23:44
问题 I am not experienced in ES (my background is more of relational databases) and I am trying to achieve the goal of having a search bar in my web application to search the entire content of it (or the content I will be willing to index in ES). The architecture implemented is Jamstack with a gatsby application fetching content (sometimes at build time, sometimes at runtime) from a strapi application (headless cms). In the middle, I developed a microservice to write the documents created in the