The current documentation of Vercel mentions to create a folder named api in the root directory. Then move the index.js (if you don't have this file you should rename your server starting file to this name) to the api folder. Then create a vercel.json file in the root directory and add the following code:
{ "version": 2, "rewrites": [{ "source": "/(.*)", "destination": "/api" }] }