Next.js: POST to a route

Created on 9 Dec 2016  ·  3Comments  ·  Source: vercel/next.js

Looking through the documentation, I don't see a way to POST to a route. Is this possible?

Most helpful comment

This would be great to clarify in the readme as I spent a little too much time thinking of the best way to solve this using only next.js before realizing that an external API app makes so much more sense :)

All 3 comments

What are you trying to achieve? Next is a client-side framework that renders html (with server-side html rendering). For any API calls (GET/POST) you will need a server environment that handles this.

Unless you configure custom routes, which is under development (https://github.com/zeit/next.js/issues/291) I would still advise a separate Node server for your backend (in Express or Hapi)

This would be great to clarify in the readme as I spent a little too much time thinking of the best way to solve this using only next.js before realizing that an external API app makes so much more sense :)

I think a great place to put this is the FAQ!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sospedra picture sospedra  ·  3Comments

timneutkens picture timneutkens  ·  3Comments

havefive picture havefive  ·  3Comments

knipferrc picture knipferrc  ·  3Comments

flybayer picture flybayer  ·  3Comments