UNPKG

just-another-http-api

Version:

A framework built on top of fastify aimed at removing the need for any network or server configuration.

9 lines (6 loc) 211 B
exports.addCustomCors = ( handlerConfig ) => ( req, reply, done ) => { Object.entries ( handlerConfig.cors ).forEach ( ( [ key, value ] ) => { reply.header ( key, value ); } ); done (); };