Switch to node v18.16.0 (using .nvmrc) :
nvm use
Install and build :
npm ci
npm run build
Then, move the built dist/index.js
file into a new directory of your extensions/interfaces
, for example extensions/interfaces/uuid-file-image/index.js
.
That's it!
If you use docker, don't forget to mount the interfaces
volume pointing to the directory containing uuid-file-image/index.js
:
volumes:
- ./path/to/local/interfaces:/directus/extensions/interfaces/
When the file's selected, I currently set in uuid field the filename_disk
key of the file.
I wanted this to be set by the user into interface options (props.file_key_to_get
: String
), but I didn't added it yet in src/index.ts
.