Set server framework
By default the library will be configured to run with express. If you are going to use another server framework, you have to change the configuration accordingly. There are 2 ways to do this:
-
Set the key-value pair
"framework": "$frameworkName"in a configuration file:{ "framework": "fastify" } -
Set the server framework from a logger instance by calling:
import log, { Framework } from "cf-nodejs-logging-support"; log.setFramework(Framework.Fastify);
Our supported server frameworks are:
- Express: declare as
expressor useFramework.Express - Connect: declare as
connector useFramework.Connect - Fastify: declare as
fastifyor useFramework.Fastify - Node.js HTTP: declare as
plainhttpor useFramework.PlainHttp