@unchainedshop/plugins
Version:
Because of a Typescript issue with upstream "postfinancecheckout", the Postfinance plugin has been disabled from transpilation, import the source ts files from src and enable node_module tsc or copy over the src/payment/postfinance-checkout to your projec
21 lines (18 loc) • 577 B
text/typescript
import { FastifyInstance } from 'fastify';
import handler from '../files/gridfs/handler-fastify.js';
const { GRIDFS_PUT_SERVER_PATH = '/gridfs/:directoryName/:fileName' } = process.env;
export default (fastify: FastifyInstance) => {
fastify.register((s, opts, registered) => {
// Disable JSON parsing!
s.removeAllContentTypeParsers();
s.addContentTypeParser('*', function (req, payload, done) {
done(null);
});
s.route({
url: GRIDFS_PUT_SERVER_PATH,
method: ['GET', 'PUT', 'OPTIONS'],
handler,
});
registered();
});
};