UNPKG

@unchainedshop/plugins

Version:

Official plugin collection for the Unchained Engine with payment, delivery, and pricing adapters

17 lines (16 loc) 543 B
import handler from "../files/gridfs/handler-fastify.js"; const { GRIDFS_PUT_SERVER_PATH = '/gridfs' } = process.env; export default (fastify) => { fastify.register((s, opts, registered) => { s.removeAllContentTypeParsers(); s.addContentTypeParser('*', function (req, payload, done) { done(null); }); s.route({ url: GRIDFS_PUT_SERVER_PATH + '/:directoryName/:fileName', method: ['GET', 'PUT', 'OPTIONS'], handler, }); registered(); }); };