Migrate all the things
* Migrates from Mongo to Postgres. * Migrates from JSPM to Webpack. * Migrates from React to Vuejs. * Migrates from Bootstrap to Bulma. Also: * Fixes rendering of meta data in the document head tag.
This commit is contained in:
parent
09706778d9
commit
7bb0497ff4
76 changed files with 6741 additions and 1760 deletions
16
lib/render.js
Normal file
16
lib/render.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
import fs from 'fs';
|
||||
import { createBundleRenderer } from 'vue-server-renderer';
|
||||
|
||||
const app = fs.readFileSync('./public/dist/js/build-server.js', 'utf8');
|
||||
|
||||
export default function(url, initialState) {
|
||||
const renderer = createBundleRenderer(app);
|
||||
return new Promise((resolve, reject) => {
|
||||
renderer.renderToString({ url, initialState }, (error, html) => {
|
||||
if(error) {
|
||||
return reject(error);
|
||||
}
|
||||
resolve(html);
|
||||
});
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue