简体   繁体   中英

How to implement Socket.io with next.js without separate node server

I want to build a chat system with Next.js. I am not sure how I have to setup the socket server.

I want this to implement Next server not with a separate server. Should I have to make a server.js file in root and run a server?

You will need to create custom server however, then you can't deploy to vercel, and you got yourself a regular nodejs application. You could use cloud providers to handle sockets for you, or as you said, you could split your application to a regular next.js app and deploy your socket application separately.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM