Fastify plugin that adds a [Micropub Media endpoint](https://www.w3.org/TR/micropub/#media-endpoint) to a Fastify server.




Fastify plugin that adds a Micropub Media endpoint to a Fastify server.
- Installation
- Fastify plugin media\-endpoint options
- Dependencies
- References
- License
``sh`
npm install @jackdbd/fastify-media-endpoint
Options for the Fastify media-endpoint plugin
Properties
|Name|Type|Description|Required|
|----|----|-----------|--------|
|ajv||Instance of Ajv
|no|
|deleteMedia
(Delete post)|Function|Deletes a post published at a URL.boolean
|yes|
|includeErrorDescription||Whether to include an error_description property in all error responses. This is meant to assist the client developer in understanding the error. This is NOT meant to be shown to the end user.false
Default: Function
|no|
|isAccessTokenRevoked||Predicate function that returns true if a jti (JSON Web Token ID) is revoked.string
|yes|
|logPrefix||Default: "[media-endpoint] "number
|no|
|me|||yes|
|multipartFormDataMaxFileSize
(multipart/form\-data max file size)||Max file size (in bytes) for multipart/form-data requests.10000000
Default: 0
Minimum: boolean
|no|
|reportAllAjvErrors
(report all AJV errors)||Whether to report all AJV validation errors.false
Default: Function
|no|
|uploadMedia
(Upload file)||Uploads a file to the Micropub server.
|yes|
Example
`json`
{
"includeErrorDescription": false,
"logPrefix": "[media-endpoint] ",
"multipartFormDataMaxFileSize": 10000000,
"reportAllAjvErrors": false
}
| Package | Version |
|---|---|
| @fastify/multipart | ^9.0.3 |^3.0.3
| @fastify/response-validation | |0.2.0-canary.8
| @jackdbd/canonical-url | |0.2.0-canary.16
| @jackdbd/fastify-hooks | |0.2.0-canary.10
| @jackdbd/fastify-utils | |0.2.0-canary.14
| @jackdbd/indieauth | |0.2.0-canary.13
| @jackdbd/micropub | |0.2.0-canary.9
| @jackdbd/oauth2-error-responses | |0.2.0-canary.12
| @jackdbd/schema-validators | |^0.34.14
| @sinclair/typebox | |^8.17.1
| ajv | |^3.0.1
| ajv-formats | |^5.0.1
| fastify-plugin | |
> [!WARNING]
> This package defines 2 peer dependencies.
| Peer | Version range |
|---|---|
| @fastify/request-context | >=6.0.0 |fastify
| | >=5.0.0` |
- Micropub media endpoint (indieweb.org)
© 2024 - 2025 Giacomo Debidda // MIT License