Next.js Discord

Discord Forum

importing functions from another nextjs project to a simple nodejs project, is it best practice?

Unanswered
Golden paper wasp posted this in #help-forum
Open in Discord
Golden paper waspOP
Hi,

I'm currently learning Kafka (https://github.com/upstash/examples/tree/main/examples/next-chatapp-with-kafka). I want to make another separate nodejs backend but I was thinking to share functions that I made in a nexjs backend and use them in the nodejs backend, so every time the kafka consumer receives a message, I can process it the same way as I do in the nextjs backend.

However, I'm wondering how does the bundler (webpack) does this? Will I leak some backend code that I import from another project? Is this the best practice? Should I?

0 Replies