DEV Community

Discussion on: What I struggled with Next.js using Firebase Hosting (and enable SSR)

Collapse
 
rosghub profile image
rosghub • Edited

Haven't tried it but I think it should work. The function plays the role of a web server which is what nextjs is designed to run on, routing the firebase functions params through the next build should run the middle wares required of the next API routes.

Although it is clever how it works, I'm skeptical at how inefficient this is compared to a traditional node server or vercel serverless deployment.

Edit: tested this today and it does work. API Routes are run via the same next server that serves the SSR pages