This pull request renders our 404 page with react.
The basic flow of operations is this:
There's a small node server (root/server.js) that takes a request like GET /root/main/404 plus a JSON body, and renders root/main/404.js with it.
On production servers, we'll probably run root/server.js as a separate daemontools service (configurable via DBDefs), but for development purposes, app.psgi will take care of forking/exec'ing it if it's not already running.
In the catalyst side of things, when initially handling a request, it checks if the requested action has a NewTemplate attribute. If it does, it calls out to MusicBrainz::Server::Renderer::handle_request, which takes care of communicating with server.js and setting the response body.
That's the overview anyway, I'll leave some more comments below.
This pull request renders our 404 page with react.
The basic flow of operations is this:
There's a small node server (root/server.js) that takes a request like
GET /root/main/404
plus a JSON body, and renders root/main/404.js with it.On production servers, we'll probably run root/server.js as a separate daemontools service (configurable via DBDefs), but for development purposes, app.psgi will take care of forking/exec'ing it if it's not already running.
In the catalyst side of things, when initially handling a request, it checks if the requested action has a
NewTemplate
attribute. If it does, it calls out toMusicBrainz::Server::Renderer::handle_request
, which takes care of communicating with server.js and setting the response body.That's the overview anyway, I'll leave some more comments below.