@fastify/static
Advanced tools
Comparing version 6.9.0 to 6.10.0
@@ -281,2 +281,3 @@ 'use strict' | ||
const routeOpts = { | ||
constraints: opts.constraints, | ||
schema: { | ||
@@ -283,0 +284,0 @@ hide: typeof opts.schemaHide !== 'undefined' ? opts.schemaHide : true |
{ | ||
"name": "@fastify/static", | ||
"version": "6.9.0", | ||
"version": "6.10.0", | ||
"description": "Plugin for serving static files as fast as possible.", | ||
@@ -57,3 +57,3 @@ "main": "index.js", | ||
"tap": "^16.0.0", | ||
"tsd": "^0.25.0" | ||
"tsd": "^0.28.0" | ||
}, | ||
@@ -60,0 +60,0 @@ "tsd": { |
@@ -29,2 +29,3 @@ # @fastify/static | ||
prefix: '/public/', // optional: default '/' | ||
constraints: { host: 'example.com' } // optional: default {} | ||
}) | ||
@@ -122,2 +123,9 @@ | ||
#### `constraints` | ||
Default: `{}` | ||
Constraints that will be added to registered routes. See Fastify's documentation for | ||
[route constraints](https://www.fastify.io/docs/latest/Reference/Routes/#constraints). | ||
#### `prefixAvoidTrailingSlash` | ||
@@ -206,3 +214,3 @@ | ||
### `serveDotFiles` | ||
#### `serveDotFiles` | ||
@@ -209,0 +217,0 @@ Default: `false` |
@@ -5,3 +5,3 @@ // Definitions by: Jannik <https://github.com/jannikkeye> | ||
import { FastifyPluginAsync, FastifyRequest } from 'fastify'; | ||
import {FastifyPluginAsync, FastifyRequest, RouteOptions} from 'fastify'; | ||
import { Stats } from 'fs'; | ||
@@ -108,2 +108,3 @@ | ||
maxAge?: string | number; | ||
constraints?: RouteOptions['constraints']; | ||
} | ||
@@ -110,0 +111,0 @@ |
@@ -6,3 +6,3 @@ import fastify, { FastifyInstance, FastifyPluginAsync, FastifyRequest } from 'fastify' | ||
import fastifyStatic, { | ||
FastifyStaticOptions, | ||
FastifyStaticOptions, | ||
fastifyStatic as fastifyStaticNamed, | ||
@@ -59,2 +59,6 @@ } from '..' | ||
return true; | ||
}, | ||
constraints: { | ||
host: /.*\.example\.com/, | ||
version: '1.0.2' | ||
} | ||
@@ -61,0 +65,0 @@ } |
Sorry, the diff of this file is too big to display
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
361299
4988
475