My nextjs app was statically generated, and previously I was able to run
next build && next export and deploy using
Now I have added some API routes and when automatic builds are enabled, the essential next plugin is able to create functions for me and the API is correctly mapped to /api/ routes. Is it possible to do this step manually with the netlify CLI?
I tried doing
netlify deploy --functions="pages/api" and the functions are deployed, but they are mapped to netlify routes ("/.netlify/functions") instead of next routes ("/api/") like they would be with the plugin run during automatic builds.
Also, I haven’t checked this but I assume the function parameters would be different as well (netlify functions being
event, context and nextJS functions having express styled