I have the following scripts in my package.json
"scripts": {
"dev": "nodemon --exec babel-node src/index.js",
"build": "NODE_ENV=PRODUCTION babel src -d dist --copy-files",
"serve": "NODE_ENV=production node dist/index.js"
},
My application builds, but only the dist/index.js is just served up as a file rather than being run.
I have tried to change serve to start but no luck.
Have also tried to run the serve script as part of the build with && - this yielded a build process that just runs.
I feel like the solution is trivial, and I am just making mistake with my scripts.
Any ideas?
Vercel is a static-first platform. You can't lift a server inside the platform and for that reason, it is not possible to use a classic "listen" approach.
Take a look at vercel.com/new and also a few examples.