text: import React from 'react';
  import express from 'express';
  import { Provider } from 'react-redux';
  import { LocaleProvider } from 'antd';
  import { StaticRouter } from 'react-router-dom';
  import { renderToString } from 'react-dom/server';
  import { store } from '../common/store/configureStore';
  import Application from '../application';
  
  /* eslint-disable */
  const assets = require(process.env.RAZZLE_ASSETS_MANIFEST);
  /* eslint-enable */
  const server = express();
  server
    .disable('x-powered-by')
    .use(express.static(process.env.RAZZLE_PUBLIC_DIR))
    .get('/*', (req, res) => {
      const context = {};
      const markup = renderToString(
        <LocaleProvider locale={require('antd/lib/locale-provider/pt_BR')}>
          <Provider store={store}>
            <StaticRouter context={context} location={req.url}>
              <Application />
            </StaticRouter>
          </Provider>
        </LocaleProvider>,
      );
  
      if (context.url) {
        res.redirect(context.url);
      } else {
        res.status(200).send(
          `<!doctype html>
  <html lang="pt-BR">
  <head>
    <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
    <meta charSet='utf-8' />
    <title>Application</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    ${assets.client.css
      ? `<link rel="stylesheet" href="${assets.client.css}">`
      : ''}
    ${process.env.NODE_ENV === 'production'
      ? `<script src="${assets.client.js}" defer></script>`
      : `<script src="${assets.client.js}" defer crossorigin></script>`}
  </head>
  <body>
    <div id="root">${markup}</div>
  </body>
  </html>`,
        );
      }
    });
  
  export default server;
  