1.0.5 • Published 3 years ago
@jscoding/fastify-server v1.0.5
@jscoding/fastify-server
fastify server 建立 fastify Instence 並 listen
Install
npm install @jscoding/fastify-server
Usage
const fastifyServer = await require('@jscoding/fastify-server')({});
Module Exports
async function(options) { }
options
:{Object}
: fastify options 參考listen
:{Object}
: listen options 參考plugins
:{(string|FastifyPluginAsync|{ plugin: (FastifyPluginAsync|string), options: Object})[]}
: 要註冊的 Plugin 列表- 項目可以是 plugin package name
- 項目可以是 FastifyPluginAsync -- ansyc (fastify, options) => { }
- 項目可以是 { plugin: 同前兩項, options: 註冊時帶的的參數 }
registerPluginBefore
:async (fastify) => {}
: 註冊前執行registerPluginAfter
:async (fastify) => {}
: 註冊後, listen 前執行
- 回傳 fastify Instence