Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Update docs based on Prs
Browse files Browse the repository at this point in the history
  • Loading branch information
rijkvanzanten committed Nov 18, 2020
1 parent 202f45f commit f8faf15
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 6 deletions.
5 changes: 5 additions & 0 deletions docs/advanced/api/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Each API instance can manage multiple projects. Each project has its own config,

Projects can be added with new config files, using this naming convention: `config/{my-project}.php`. Each project's config should point to a dedicated database and unique storage paths. Once configured, the API URL will be scoped to the project, eg: `https://api.example.com/my-project/collections`.

::: tip
All the available API options are available in the ```config/_example.php``` file :
https://github.com/directus/directus/blob/master/config/\_example.php
:::

### Private / Public Projects

By default, the API will return all available projects in the API through the `/server/projects` endpoint. If you would like to prevent a project key from being returned in this endpoint, you can prepend the config file name with `private.` (for example `my-project.php` -> `private.my-project.php`).
Expand Down
4 changes: 2 additions & 2 deletions docs/api/files.md
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ Returns the [file object](#the-file-object) for the file that was just updated.

```json
{
"data": {
"data": [{
"id": 50,
"storage": "local",
"filename_disk": "904695e3-bd5b-4ba5-a569-6f481f08a285.jpeg",
Expand Down Expand Up @@ -635,7 +635,7 @@ Returns the [file object](#the-file-object) for the file that was just updated.
],
"embed": null
}
}
}]
}
```

Expand Down
4 changes: 4 additions & 0 deletions docs/docker/environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
| DIRECTUS_STORAGE_OSSBUCKET | string | "oss-bucket" |
| DIRECTUS_STORAGE_OSSENDPOINT | string | "oss-endpoint" |

:::tip
If you own an OVH Cloud Storage (OpenStack) instance, you can use the Swift S3 API (https://docs.ovh.com/gb/en/public-cloud/getting_started_with_the_swift_S3_API/) to connect to your object storage using the s3 adpater.
:::

### Storage Options

| Variable | Type | Default Value |
Expand Down
8 changes: 5 additions & 3 deletions docs/extensions/storage-adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ If are using the Directus Suite version, this version is missing the `composer.j

`composer require league/flysystem-aws-s3-v3`

Then simply set the following into your configuration file (by default `config/api.php`):
Then simply set the following into your configuration file (by default `config/<project-name>.php`):

```php
'storage' => [
Expand All @@ -36,16 +36,18 @@ Then simply set the following into your configuration file (by default `config/a
'ACL' => 'public-read',
'CacheControl' => 'max-age=604800'
],
'endpoint' => 's3-endpoint',
'endpoint' => 's3-endpoint || http://s3-<region>.amazonaws.com',
'root' => '/',
'thumb_root' => '/thumbnails',
'root_url' => 'http://<bucket>.s3-<region>.amazonaws.com',
'root_url' => '/',
]
```

- The `root` option indicates the root path of all uploads.
- The `thumb_root` option indicates the root path where all the thumbnails are going to be stored.
- The `root_url` is the URL to access all the files stored in the bucket, such as your bucket url, or AWS CloudFront URL.
- The `endpoint` is the url which s3 is accessed usually in the format of `http://s3-<region>.amazonaws.com`
- The `key` and `secret` is created by IAM access keys

Read more about the ACL permissions here: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl.

Expand Down
23 changes: 22 additions & 1 deletion docs/guides/js-sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,31 @@ async function fetchAllItems() {

## Reference

Note that all of the following methods are asynchronous and return promises.
Note that all of the following methods are asynchronous and return promises, unless explicitely noted.

If you think a method is missing, please reach out on GitHub or [Slack](https://directus.chat)!

### Asset

#### `getAssetUrl(private_hash, params?)`

Return the URL of an asset's original or thumbnail.

See [API Assets (Thumbnails)](../api/assets.md) for the structure of the `params` object.
If `params` is empty or `undefined`, the URL of the original will be returned.

:::tip
This method is synchronous.
:::

#### `getAsset(private_hash, params?)`

Return an asset's original or its thumbnail as an ArrayBuffer.

See [API Assets (Thumbnails)](../api/assets.md) for the structure of the `params` object.
If `params` is empty or `undefined`, the URL of the original will be returned.


### Authentication

#### `login(credentials)`
Expand Down

0 comments on commit f8faf15

Please sign in to comment.