fastify-bearer-auth:Fastify 插件需要承载授权标头

时间:2024-08-12 11:30:23
【文件属性】:

文件名称:fastify-bearer-auth:Fastify 插件需要承载授权标头

文件大小:12KB

文件格式:ZIP

更新时间:2024-08-12 11:30:23

JavaScript

fastify-bearer-auth fastify-bearer-auth为 web 框架提供了一个简单的请求钩子。 例子 'use strict' const fastify = require ( 'fastify' ) ( ) const bearerAuthPlugin = require ( 'fastify-bearer-auth' ) const keys = new Set ( [ 'a-super-secret-key' , 'another-super-secret-key' ] ) fastify . register ( bearerAuthPlugin , { keys } ) fastify . get ( '/foo' , ( req , reply ) => { reply . send ( { authenticated : true } )


【文件预览】:
fastify-bearer-auth-master
----.gitignore(2KB)
----.github()
--------stale.yml(772B)
--------workflows()
--------dependabot.yml(261B)
----.taprc(21B)
----test()
--------integration.test.js(4KB)
--------hook.test.js(11KB)
--------plugin.test-d.ts(1KB)
--------decorate.test.js(445B)
----plugin.d.ts(931B)
----LICENSE(1KB)
----plugin.js(4KB)
----Readme.md(5KB)
----package.json(1KB)

网友评论