Auto-commit 2026-04-29 16:31

This commit is contained in:
2026-04-29 16:31:27 -04:00
parent e8687bb6b2
commit 0495ee5bd2
19691 changed files with 3272886 additions and 138 deletions

46
node_modules/@fastify/helmet/examples/example.js generated vendored Normal file
View File

@@ -0,0 +1,46 @@
'use strict'
const Fastify = require('fastify')
const helmet = require('..')
const fastify = Fastify({
logger: {
level: 'info'
}
})
fastify.register(helmet)
const opts = {
schema: {
response: {
200: {
type: 'object',
properties: {
hello: {
type: 'string'
}
}
}
}
}
}
fastify.get('/', opts, function (_request, reply) {
reply
.header('Content-Type', 'application/json')
.code(200)
.send({ hello: 'world' })
})
fastify.get('/route-with-disabled-helmet', { ...opts, helmet: false }, function (_request, reply) {
reply
.header('Content-Type', 'application/json')
.code(200)
.send({ hello: 'world' })
})
fastify.listen({ port: 3000 }, err => {
if (err) throw err
fastify.log.info(`Server listening on ${fastify.server.address().address}:${fastify.server.address().port}`)
})