Skip to content

Commit

Permalink
Merge branch 'master' into fix/#4487/filteringDataManyWayError500
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Noël committed Mar 23, 2020
2 parents 0c7029c + 88de1fa commit d39af72
Show file tree
Hide file tree
Showing 46 changed files with 515 additions and 301 deletions.
6 changes: 3 additions & 3 deletions docs/3.0.0-beta.x/admin-panel/customization.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Customization

The administration panel can be customized according to your needs, so you can make it reflects your identity.
The administration panel can be customized according to your needs, so you can make it reflect your identity.

::: warning
To apply your changes you need to [rebuild](#build) your admin panel
Expand All @@ -25,6 +25,8 @@ By default, the administration panel is exposed via [http://localhost:1337/admin
}
```

The panel will be available through [http://localhost:1337/dashboard](http://localhost:1337/dashboard) with the configurations above.

## Change the host

By default, the administration panel client host name is `localhost`. However, you can change this setting by updating the `admin` configuration:
Expand All @@ -44,8 +46,6 @@ By default, the administration panel client host name is `localhost`. However, y
}
```

The panel will be available through [http://localhost:1337/dashboard](http://localhost:1337/dashboard) with the configurations above.

## Development mode

To enable the front-end development mode you need to start your application using the `--watch-admin` flag.
Expand Down
2 changes: 1 addition & 1 deletion docs/3.0.0-beta.x/admin-panel/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ You might want to change the path to access to the administration panel. Here th

## Deploy the administration panel on another server (AWS S3, Azure, etc) than the API.

It's very common to deploy the front-end and the back-end on different servers. Here the required configurations to handle this case:
It's very common to deploy the front-end and the back-end on different servers. Here are the required configurations to handle this case:

**Path —** `./config/environment/**/server.json`.

Expand Down
4 changes: 2 additions & 2 deletions docs/3.0.0-beta.x/cli/CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,15 +281,15 @@ options [--delete-files]
- **strapi uninstall &#60;name&#62; --delete-files**<br/>
Uninstalls a plugin called **&#60;name&#62;** and removes the files in `./extensions/name/`

Example: `strapi uninstall graphql` will remove the plugin `strapi-plugin-graphql` and all the files in `./extensions/graphql`
Example: `strapi uninstall graphql --delete-files` will remove the plugin `strapi-plugin-graphql` and all the files in `./extensions/graphql`

::: warning
Some plugins have admin panel integrations, your admin panel might have to be rebuilt. This can take some time.
:::

## strapi console

Start the server and let you eval commands into your application in real time.
Start the server and eval commands in your application in real time.

```bash
strapi console
Expand Down
4 changes: 2 additions & 2 deletions docs/3.0.0-beta.x/concepts/configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,15 +480,15 @@ As an example using this configuration with Nginx your server would respond to `

## Dynamic configurations

For security reasons, sometimes it's better to set variables through the server environment. It's also useful to push dynamic values into configurations files. To enable this feature into JSON files, Strapi embraces a JSON-file interpreter into its core to allow dynamic values in the JSON configuration files.
For security reasons, sometimes it's better to set variables through the server environment. It's also useful to push dynamic values into configuration files. To enable this feature in JSON files, Strapi embraces a JSON-file interpreter into its core to allow dynamic values in the JSON configuration files.

#### Syntax

The syntax is inspired by the [template literals ES2015 specifications](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals). These dynamic values are indicated by the Dollar sign and curly braces (`${expression}`).

#### Usage

In any JSON configuration files in your project, you can inject dynamic values like this:
In any JSON configuration file in your project, you can inject dynamic values like this:

**Path —** `./config/environments/production/database.json`.

Expand Down
2 changes: 1 addition & 1 deletion docs/3.0.0-beta.x/concepts/controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In this example, any time a web browser is pointed to the `/hello` URL on your a

### Where are the controllers defined?

The controllers are defined in each `./api/**/controllers/` folders. Every JavaScript file put in these folders will be loaded as a controller. They are also available through the `strapi.controllers` and `strapi.api.**.controllers` global variables. By convention, controllers' names should be Pascal-cased, so that every word in the file (include the first one) is capitalized `User.js`, `LegalEntity.js`.
The controllers are defined in each `./api/**/controllers/` folder. Every JavaScript file put in these folders will be loaded as a controller. They are also available through the `strapi.controllers` and `strapi.api.**.controllers` global variables. By convention, controllers' names should be Pascal-cased, so that every word in the file (including the first one) is capitalized `User.js`, `LegalEntity.js`.

## Core controllers

Expand Down
2 changes: 1 addition & 1 deletion docs/3.0.0-beta.x/concepts/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Extensions folder structure:

## Admin extension

The admin panel is a `node_module` that is similar to a plugin, with the slight difference that it encapsulates all the installed plugin of your application.
The admin panel is a `node_module` that is similar to a plugin, with the slight difference that it encapsulates all the installed plugins of your application.

To extend this package you will have to create an `admin` folder at the root of your application.

Expand Down
8 changes: 6 additions & 2 deletions docs/3.0.0-beta.x/concepts/file-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ By default, your project's structure will look like this:

- `/.cache`: contains files used to build your admin panel.
- [`/admin`](../admin-panel/customization.md): contains your admin customization files.
- `/api`: contains the business logic of your project split in sub-folder per API.
- `/api`: contains the business logic of your project split into sub-folders per API.
- `**`
- `/config`: contains the API's configurations ([`routes`](./routing.md), [`policies`](./policies.md), etc.).
- [`/controllers`](./controllers.md): contains the API's custom controllers.
Expand All @@ -19,19 +19,23 @@ By default, your project's structure will look like this:
- [`database.json`](./configurations.md#database): contains the database connections for this environment.
- [`request.json`](./configurations.md#request): contains the request settings for this environment.
- [`response.json`](./configurations.md#response): contains the response settings for this environment.
- [`security.json`](./configurations.md#security): contains the security settings for this environment.
- [`server.json`](./configurations.md#server): contains the server settings for this environment.
- `/production`
- `/staging`
- [`/functions`](./configurations.md#functions): contains lifecycle or generic functions of the project.
- [`/responses`](./configurations.md#responses): contains custom responses.
- [`404.js`](./configurations.md#404): contains a template for constructing your custom 404 message.
- [`bootstrap.js`](./configurations.md#bootstrap): contains the code executed at the application start.
- [`cron.js`](./configurations.md#cron-tasks): contains the cron tasks.
- [`application.json`](./configurations.md#application): contains the general configurations of the project.
- [`custom.json`](./configurations.md#custom): contains the custom configurations of the project.
- [`hook.json`](./configurations.md#hook): contains the hook settings of the project.
- [`language.json`](./configurations.md#language): contains the language settings of the project.
- [`middleware.json`](./configurations.md#middleware): contains the middleware settings of the project.
- [`/extensions`](./customization.md): contains the files to extend installed plugins.
- [`/hooks`](./hooks.md): contains the custom hooks of the project.
- [`/middlewares`](./middlewares.md): contains the custom middlewares of the project.
- [`/plugins`](./plugins.md): contains your local plugins.
- [`/public`](./public-assets.md): contains the file accessible to the outside world.
- [`/public`](./public-assets.md): contains the files accessible to the outside world.
- `/node_modules`: contains the npm packages used by the project.
2 changes: 1 addition & 1 deletion docs/3.0.0-beta.x/concepts/logging.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Logging

Strapi relies on an extremely fast Node.js logger called Pino that includes a shell utility to pretty-print its log files. It provides great performances and doesn't slow down your app. The logger is accessible through the global variable `strapi.log` or the request's context `ctx.log` if enabled.
Strapi relies on an extremely fast Node.js logger called Pino that includes a shell utility to pretty-print its log files. It provides great performance and doesn't slow down your app. The logger is accessible through the global variable `strapi.log` or the request's context `ctx.log` if enabled.

```js
// Folder.js controller
Expand Down
2 changes: 1 addition & 1 deletion docs/3.0.0-beta.x/concepts/middlewares.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ The middlewares are injected into the Koa stack asynchronously. Sometimes it hap
}
```

The `responseTime` middleware will be loaded first. Immediately followed by the `logger` middleware. Then, the others middlewares will be loaded asynchronously.
The `responseTime` middleware will be loaded first. Immediately followed by the `logger` middleware. Then, the other middlewares will be loaded asynchronously.

**Load a middleware after another one**

Expand Down
2 changes: 1 addition & 1 deletion docs/3.0.0-beta.x/concepts/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ In this example, there is a `Restaurant` model which contains the attributes `co

### Where are the models defined?

The models are defined in each `./api/**/models/` folder. Every JavaScript or JSON file in these folders will be loaded as a model. They are also available through the `strapi.models` and `strapi.api.**.models` global variables. Usable everywhere in the project, they contain the ORM model object that they refer to. By convention, models' names should be written in lowercase.
The models are defined in each `./api/**/models/` folder. Every JavaScript or JSON file in these folders will be loaded as a model. They are also available through the `strapi.models` and `strapi.api.**.models` global variables. Usable everywhere in the project, they contain the ORM model object that they refer to. By convention, a model's name should be written in lowercase.

## How to create a model?

Expand Down
6 changes: 3 additions & 3 deletions docs/3.0.0-beta.x/concepts/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = {

## Querying data

We added a new API to query data based on the new filters API.
We added a new filters API to query the database.

```js
const { convertRestQueryParams, buildQuery } = require('strapi-utils');
Expand Down Expand Up @@ -64,7 +64,7 @@ If you are using a mongo database, calling `buildQuery` returns either a [`Mongo
#### Custom Query

When using the deep filtering feature with mongo, we build an aggregation query to avoid too many round-trips to the Mongo DB.
Doing that means we don't get a Mongoose object as a response but instead a plain JS Object. This brings some issues, like no virtual fields available and no Mongoose life cycles.
Doing that means we don't get a Mongoose object as a response but instead a plain JS Object. This brings some issues, like no virtual fields available and no Mongoose lifecycles.

To deliver the best possible experience, we decided to rehydrate the Mongoose models, forcing us to override the Mongoose query

Expand All @@ -80,6 +80,6 @@ returns a query with the following functions

- `count` => Returns an integer equal to the number of matching entities.
- `lean` => Returns the matching elements as Objects.
- `then(onSucces, onFailure)` => Calls the onSucces with an array of Mongoose objects.
- `then(onSuccess, onFailure)` => Calls the onSuccess with an array of Mongoose objects.
- `catch(onError)` => Promise catch.
- `group(options)` => Calls the aggregation group function of Mongoose.
4 changes: 2 additions & 2 deletions docs/3.0.0-beta.x/concepts/policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = async (ctx, next) => {
In this example, we are verifying that a session is open. If it is the case, we call the `next()` method that will execute the next policy or controller's action. Otherwise, a 401 error is returned.

::: tip
You can access any controller, service or model thanks to the global variable `strapi` in a policy.
You can access any controller, service, or model thanks to the global variable `strapi` in a policy.
:::

## Usage
Expand Down Expand Up @@ -67,7 +67,7 @@ The global policies can be associated to any route in your project.
Before executing the `find` action in the `Restaurant.js` controller, the global policy `isAuthenticated` located in `./config/policies/isAuthenticated.js` will be called.

::: tip
You can put as much policy you want in this array. However be careful about the performance impact.
You can put as much policy as you want in this array. However be careful about the performance impact.
:::

### Plugins policies
Expand Down
4 changes: 2 additions & 2 deletions docs/3.0.0-beta.x/concepts/public-assets.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Public Assets

Public assets are static files such as images, video, css, etc. that you want to make accessible to the outside world. Every new project includes, by default, a folder named `./public`.
Public assets are static files such as images, video, css, etc. that you want to make accessible to the outside world.

Because an API may need to serve static assets, every new Strapi project includes by default, a folder named `/public`. Any file located in this directory is accessible if the request's path doesn't match any other defined route and if it matches a public file name.

Expand All @@ -13,7 +13,7 @@ An image named `company-logo.png` in `./public/` is accessible through `/company
:::

::: warning
The dotfiles are not exposed. It means that every file where the names start with a `.`, such as `.htaccess` or `.gitignore`, are not served.
The dotfiles are not exposed. It means that every file name that starts with `.`, such as `.htaccess` or `.gitignore`, are not served.
:::

Refer to the [public assets configurations](./configurations.md#Application) for more information.
4 changes: 2 additions & 2 deletions docs/3.0.0-beta.x/concepts/routing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

`./api/**/config/routes.json` files define all available endpoints for the clients.

By default Strapi generate endpoints for all your Content Types. More information in the [Content API](../content-api/api-endpoints.md) documentation.
By default, Strapi generates endpoints for all your Content Types. More information is in the [Content API](../content-api/api-endpoints.md) documentation.

## How to create a route?

Expand Down Expand Up @@ -47,7 +47,7 @@ You have to edit the `routes.json` file in one of your APIs folders (`./api/**/c
- `path` (string): URL starting with `/` (e.g. `/restaurants`).
- `handler` (string): Action to execute when the route is hit following this syntax `<Controller>.<action>`.
- `config`
- `policies` (array): Array of policy names or path ([see more](./policies.md)).
- `policies` (array): Array of policy names or paths ([see more](./policies.md))
- `prefix` (string): Set a prefix to this route. Also, it will be loaded into the main router (useful feature for a plugin).

## Dynamic parameters
Expand Down
2 changes: 1 addition & 1 deletion docs/3.0.0-beta.x/concepts/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Services are a set of reusable functions. They are particularly useful to respec

## Core services

When you create a new `Content Type` or a new model. You will see a new empty service has been created. It is because Strapi builds a generic service for your models by default and allows you to override and extend it in the generated files.
When you create a new `Content Type` or a new model, you will see a new empty service has been created. It is because Strapi builds a generic service for your models by default and allows you to override and extend it in the generated files.

### Extending a Model Service

Expand Down
20 changes: 0 additions & 20 deletions docs/3.0.0-beta.x/content-api/api-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,26 +176,6 @@ Here is the list of endpoints generated for each of your **Content Types**.

</div>

:::

::: tab About

`About` **Content Type**

<div id="endpoint-table">

| Method | Path | Description |
| :----- | :------- | :----------------------- |
| GET | `/about` | Get the about content |
| PUT | `/about` | Update the about content |
| DELETE | `/about` | Delete the about content |

</div>

:::

::::

### Collection Types

:::: tabs
Expand Down

0 comments on commit d39af72

Please sign in to comment.