I've a nodejs/express application hosted on vercel. The way I've set it up is that when the server starts it connects to the database (mongo atlas) and checks if there's a user by the username of admin or not if it's not there then it will create one.
I had to delete my data from the database. And now I need to restart the nodejs server so that it can automatically create the user. Which is required to login to the application.
any idea how to restart the server. So that it can reconnect to the mongodb and after that it creates the required user.
I've redeply the app multiple times but that doesn't seem to restart it as no new user was created. This is my vercel.json file
{
"version": 2,
"name": "mf-backend",
"builds": [
{ "src": "server.js", "use": "@vercel/node" }
],
"routes": [
{ "src": "/(.*)", "dest": "/server.js" }
]
}
I've a nodejs/express application hosted on vercel. The way I've set it up is that when the server starts it connects to the database (mongo atlas) and checks if there's a user by the username of admin or not if it's not there then it will create one.
I had to delete my data from the database. And now I need to restart the nodejs server so that it can automatically create the user. Which is required to login to the application.
any idea how to restart the server. So that it can reconnect to the mongodb and after that it creates the required user.
I've redeply the app multiple times but that doesn't seem to restart it as no new user was created. This is my vercel.json file
{
"version": 2,
"name": "mf-backend",
"builds": [
{ "src": "server.js", "use": "@vercel/node" }
],
"routes": [
{ "src": "/(.*)", "dest": "/server.js" }
]
}
Share
Improve this question
asked Oct 30, 2022 at 14:28
Zullu BaltiZullu Balti
731 silver badge7 bronze badges
3
- Do you want to restart the app only ? If that is it, you can restart the app on vercel dashboard. You go to deployement section then you will see all deployements. You can redeploy it after you clicked the settings icon on the deploy item. – Halil Commented Oct 30, 2022 at 20:13
- Yes, I only want to restart the server (node/express). And redeploying it isn't restarting the server. – Zullu Balti Commented Oct 31, 2022 at 4:39
- also any way to check the logs like we can do in heroku? – Zullu Balti Commented Oct 31, 2022 at 5:06
1 Answer
Reset to default 5Go to vercel page.
Click the project you created.
Click the deployments section on the left-top menu.
There will be deployments. If you want to re-deploy your last deploy, click the settings icon then select redeploy selection on the dropdown menu.
Then the project will be redeployed according to your last deployment.
If you want to examine the deployment logs, you can examine logs on "View Build Logs" and "View Function Logs". They are on the project's main page.