Open yeikel opened 1 year ago
I migrate my small project following this example https://github.com/hoangvvo/next-connect/blob/main/examples/nextjs/src/pages/api/users/index.ts
I am having an issue migrating because we use nc
and multer
import nc from "next-connect";
const sharp = require('sharp');
import multer from "multer";
import { connectToDatabase, disconnectFromDatabase } from '../../../libraries/mongodb';
import { Double, MongoClient, ObjectId } from 'mongodb'
const { Configuration, OpenAIApi } = require("openai");
const { exec } = require("child_process");
import { nanoid } from 'nanoid';
import { Storage } from '@google-cloud/storage';
const path = require('path');
const publicUrls = [];
const showInfo = [];
const configuration = new Configuration({
apiKey: process.env.OPENAI_KEY,
});
const delay = ms => new Promise(resolve => setTimeout(resolve, ms))
export const config = {
api: {
responseLimit: false,
bodyParser: false,
},
};
const handler = nc({ attachParams: true });
let storage = multer.memoryStorage({});
const maxSize = 2000 * 1024 * 1024;
let upload = multer({
storage: storage,
limits: { fileSize: maxSize },
});
let uploadFile = upload.any();
handler.use(uploadFile);
handler.post(async (req, res) => {
Could anyone help with how to update the start of this code to be the latest?
What happened to attachParams
?
Hi team,
I inherited a project using
0.13.0
and I just noticed that we had a milestone major release1.0.0
Are there breaking changes with this version?
Is there any documentation about the changes needed?
Thanks!