next-connect icon indicating copy to clipboard operation
next-connect copied to clipboard

Migration guide from 0.13.0?

Open yeikel opened this issue 2 years ago • 3 comments

Hi team,

I inherited a project using 0.13.0 and I just noticed that we had a milestone major release 1.0.0

Are there breaking changes with this version?

Is there any documentation about the changes needed?

Thanks!

yeikel avatar May 05 '23 14:05 yeikel

I migrate my small project following this example https://github.com/hoangvvo/next-connect/blob/main/examples/nextjs/src/pages/api/users/index.ts

faouziMohamed avatar May 07 '23 09:05 faouziMohamed

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?

redimongo avatar May 22 '23 07:05 redimongo

What happened to attachParams?

jmsherry avatar Nov 12 '23 04:11 jmsherry