#Trying to deploy project to vercel

1 messages · Page 1 of 1 (latest)

sage inlet
#

I'm deploying my app to vercel and I'm using node express for the server and next.js for client. When I run them both locally it works but vercel deployment is different. This is my first time deploying a full application, but like only the client can run and the server doesn't. I figured to ask here because I can't find a lot of doc's online that are very helpful/I think it might screw up my already working code if I try anything experimental. I
Here is my vercel.json: {
"version": 2,
"builds": [
{
"src": "webjournal/package.json",
"use": "@vercel/next"
},
{
"src": "server/server.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/api/(.)",
"dest": "/server/server.js"
},
{
"src": "/(.
)",
"dest": "/webjournal/$1"
}
]
}

and my server.js:

golden bloomBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

sage inlet
#

I deployed the server and client separately on vercel, the server gives me a error 500 and the client works but the routes with parameters give me a 404. to fix the server I did the whole rename it index.js and put it in a folder called api or whatever but that didn't work when I was deploying it.

errant sierra
#

If I understood correctly, you are running two separate projects. One is Next.js client-side and one is a Node.js backend project. If that is the case, you'd have deployed it separately in Vercel. How have you deployed it to vercel?

sage inlet
errant sierra
#

Oh okay, you've set up monorepo. BTW I cannot view your deployment on Vercel.