The pages / apis should go under /api
directory.
For example:
/api/index.js
- http://localhost:3000/api/
/api/test.js
- http://localhost:3000/api/test
Then simply run now dev
from the root directory to run it in local environment. If all looks good, deploy in prod using now
.