From 37483bc54fea95158ffa9ef09cc0882c41ee8c65 Mon Sep 17 00:00:00 2001 From: dzucconi Date: Mon, 17 Sep 2018 14:23:04 -0400 Subject: [PATCH] Gets profiles rendering --- apps/index.coffee | 4 ++++ apps/profile/Routes.js | 15 +++++++++++++++ apps/profile/index.jade | 13 +++++++++++++ apps/profile/index.js | 22 ++++++++++++++++++++++ 4 files changed, 54 insertions(+) create mode 100644 apps/profile/Routes.js create mode 100644 apps/profile/index.jade create mode 100644 apps/profile/index.js diff --git a/apps/index.coffee b/apps/index.coffee index d67443b185..dabfb39379 100644 --- a/apps/index.coffee +++ b/apps/index.coffee @@ -85,6 +85,10 @@ app.use(require('../apps/examples')) console.timeEnd('examples') # Dynamic routing (in order) +console.time('profile') +app.use(require('../apps/profile')) +console.timeEnd('profile') + console.time('user') app.use(require('../apps/user')) console.timeEnd('user') diff --git a/apps/profile/Routes.js b/apps/profile/Routes.js new file mode 100644 index 0000000000..00c3d66384 --- /dev/null +++ b/apps/profile/Routes.js @@ -0,0 +1,15 @@ +import React from 'react'; +import { Switch, Route } from 'react-router-dom'; + +import parseRoute from 'react/util/parseRoute'; + +import ProfilePage from 'react/pages/profile/ProfilePage'; + +export default () => ( + + )} + /> + +); diff --git a/apps/profile/index.jade b/apps/profile/index.jade new file mode 100644 index 0000000000..488145f4b6 --- /dev/null +++ b/apps/profile/index.jade @@ -0,0 +1,13 @@ +extends ../../components/layout/index + +block meta + != apollo.styles + +block body + #apolloMount.Constrain + != apollo.html + +block scripts + script. + window.__APOLLO_STATE__ = !{JSON.stringify(apollo.state).replace(/ { + req.apollo.render(withStaticRouter(Routes)) + .then((apollo) => { + res.render('index', { apollo }); + }) + .catch(next); + }); + +module.exports = app;