0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-03 06:12:51 +00:00

Update vitreum (#946)

- Updates Vitreum to v6.0.1 + some custom fixes.
  - Stylesheets must be imported with `require('./sheet.less');` but can also can now share stylesheets between jsx components.
  - Should eliminate a lot of security concerns with older nested dependencies.
  - Changed a lot of files to make this work
- Also removes dependency on PicoRouter in favor of React-Router
This commit is contained in:
Trevor Buckner
2020-05-19 01:36:31 -04:00
committed by GitHub
parent 7c813be13a
commit 22a9799674
38 changed files with 3901 additions and 4518 deletions

View File

@@ -121,21 +121,20 @@ app.get('/print/:id', (req, res, next)=>{
//Render the page
const render = require('vitreum/steps/render');
//const render = require('.build/render');
const templateFn = require('./client/template.js');
app.use((req, res)=>{
render('homebrew', templateFn, {
const props = {
version : require('./package.json').version,
url : req.originalUrl,
welcomeText : welcomeText,
changelog : changelogText,
brew : req.brew,
brews : req.brews,
account : req.account
})
.then((page)=>{
return res.send(page);
})
account : req.account,
};
templateFn('homebrew', props)
.then((page)=>res.send(page))
.catch((err)=>{
console.log(err);
return res.sendStatus(500);