Re:Next.js 7
by timneutkens on Wednesday September 19, 2018 @05:36PM
(#18027901)
create-react-app is actually removing this feature in an upcoming release. We don't have plans to include it as a feature to Next.js as you can already implement it using a custom server. We do have an example for it: https://github.com/zeit/next.js/tree/canary/examples/with-cu...
Re:Next.js 7
by thrower123 on Wednesday September 19, 2018 @09:47PM
(#18029134)
Why is it being removed?
To let an external express server handle it. Which they think will be better than the current in house solution.
In a Next.js + Now context you'd use the path alias feature [1] of now in production, using a rules.json file to do the route mappings to other microservices or external URLs.
In development you'd use micro-proxy [2] and define a rules-dev.json with local mappings, and then have a package.json script to fire up that proxy for local testing.
Re:Next.js 7
by true_religion on Thursday September 20, 2018 @02:22PM
(#18034474)
I have done it in the reverse way: have django act to proxy requests to the node server.
That way ypu can use django sessions, authentication, login, admin, etc.
The node server just does rendering, and creates client side JS based on data it is given by Django.
It took 25 lines of code, yes, but pretty much worth it if you have a long term project like a single app that your company is built around.
In Next you've had to either set up and configure nginx locally or proxia via an Express server, both options that that are a bit of a hassle to set up for such a common case.