mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-04 08:12:39 +00:00
Add UI route for testing
This commit is contained in:
@@ -11,6 +11,7 @@ const SharePage = require('./pages/sharePage/sharePage.jsx');
|
|||||||
const NewPage = require('./pages/newPage/newPage.jsx');
|
const NewPage = require('./pages/newPage/newPage.jsx');
|
||||||
//const ErrorPage = require('./pages/errorPage/errorPage.jsx');
|
//const ErrorPage = require('./pages/errorPage/errorPage.jsx');
|
||||||
const PrintPage = require('./pages/printPage/printPage.jsx');
|
const PrintPage = require('./pages/printPage/printPage.jsx');
|
||||||
|
const UIPage = require('./pages/basePages/uiPage/uiPage.jsx');
|
||||||
|
|
||||||
const Homebrew = createClass({
|
const Homebrew = createClass({
|
||||||
displayName : 'Homebrewery',
|
displayName : 'Homebrewery',
|
||||||
@@ -56,6 +57,7 @@ const Homebrew = createClass({
|
|||||||
<Route path='/print' exact component={(routeProps)=><PrintPage query={queryString.parse(routeProps.location.search)} />}/>
|
<Route path='/print' exact component={(routeProps)=><PrintPage query={queryString.parse(routeProps.location.search)} />}/>
|
||||||
<Route path='/changelog' exact component={()=><SharePage brew={this.props.brew} />}/>
|
<Route path='/changelog' exact component={()=><SharePage brew={this.props.brew} />}/>
|
||||||
<Route path='/faq' exact component={()=><SharePage brew={this.props.brew} />}/>
|
<Route path='/faq' exact component={()=><SharePage brew={this.props.brew} />}/>
|
||||||
|
<Route path='/ui' exact component={()=><UIPage brew={this.props.brew} uiItems={this.props.uiItems} />}/>
|
||||||
<Route path='/v3_preview' exact component={()=><HomePage brew={this.props.brew} />}/>
|
<Route path='/v3_preview' exact component={()=><HomePage brew={this.props.brew} />}/>
|
||||||
<Route path='/' component={()=><HomePage brew={this.props.brew} />}/>
|
<Route path='/' component={()=><HomePage brew={this.props.brew} />}/>
|
||||||
</Switch>
|
</Switch>
|
||||||
|
|||||||
@@ -272,6 +272,16 @@ app.get('/print/:id', asyncHandler(async (req, res, next)=>{
|
|||||||
return next();
|
return next();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
//UI Page
|
||||||
|
app.get('/ui', asyncHandler(async (req, res, next)=>{
|
||||||
|
const brew = {
|
||||||
|
title : 'UI PAGE'
|
||||||
|
};
|
||||||
|
req.brew = brew;
|
||||||
|
return next();
|
||||||
|
}));
|
||||||
|
|
||||||
|
|
||||||
const nodeEnv = config.get('node_env');
|
const nodeEnv = config.get('node_env');
|
||||||
const isLocalEnvironment = config.get('local_environments').includes(nodeEnv);
|
const isLocalEnvironment = config.get('local_environments').includes(nodeEnv);
|
||||||
// Local only
|
// Local only
|
||||||
@@ -286,8 +296,6 @@ if(isLocalEnvironment){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//Render the page
|
//Render the page
|
||||||
const templateFn = require('./../client/template.js');
|
const templateFn = require('./../client/template.js');
|
||||||
app.use((req, res)=>{
|
app.use((req, res)=>{
|
||||||
|
|||||||
Reference in New Issue
Block a user