Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration guide from 0.13.0? #225

Open
yeikel opened this issue May 5, 2023 · 3 comments
Open

Migration guide from 0.13.0? #225

yeikel opened this issue May 5, 2023 · 3 comments

Comments

@yeikel
Copy link

yeikel commented May 5, 2023

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!

@faouziMohamed
Copy link

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

@redimongo
Copy link

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?

@jmsherry
Copy link

What happened to attachParams?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants