React server rendering, pt. 1

Merged
#1590 · Created  · Last updated

Merged pull request

Merge branch 'react-server' into beta

6cceced·Author: ·Closed by: ·2015-10-22

Description

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.

0 attachments

0 comments

Loading commits...