It is working in localhost well. But I wanted to deploy it in vercel.com to make the server public. I added the now.json file to the main directory. It includes these codes.
This is a picture from my directories.
So when I deploy my app to vercel via github,it is not working. I dont know if I am missing sth in my now.json file.
@Marmiz Yes, you can. Take a look at this essay. Deploy Express.js app to Vercel - DEV Community It is explaining how to do it .I didn’t want to deploy it to Heroku due to it restrict me to only 5 projects. I couldn’t deploy more than 5 projects. So I want to choose it actually
That blog post tells you exactly to do what Vercel describe as a Serverless API:
The project needs to live in an /api folder for instance.
On the other hand seems your api are living inside a route folder.
Moreover that article is talking about a vercel.json file, while you mention a now.json.
Anyway I am still not 100% sold that the above will create an app instance.
It’s still possible that Vercel will deploy it as a serverless function.
[EDIT]
Regardless of the implication of the architectural difference that you may or may not care about, I would still follow the official Vercel documentation.