Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var JSX = require('node-jsx').install();
var React = require('react');
var Homepage = React.createElement(require('./views/home.jsx'));
var template = require('./views/global.jsx');
module.exports = function(app){
app.get("/*", function(req, res){
console.log("GET request for: " + req.url);
res.send(React.renderToString(React.createElement(template, {path:req.url})))
});
}
var JSX = require('node-jsx').install();
var React = require('react');
var Homepage = React.createElement(require('./views/home.jsx'));
var template = require('./views/global.jsx');
module.exports = function(app){
app.get("/*", function(req, res){
console.log("GET request for: " + req.url);
res.send(React.renderToString(React.createElement(template, {path:req.url})))
});
}
init(http) {
super.init(http);
let defaultOption = {
jsx: true,
extension: '.jsx',
'root_path': 'component',
'lower_name': true,
'left_delimiter': '{',
'right_delimiter': '}'
};
this.option = think.extend(defaultOption, this.config('react_render'));
if (this.option.jsx) {
require('node-jsx').install({extension: this.option.extension});
}
}
'use strict';
require('node-jsx').install();
var morpheus = require('./morpheus');
morpheus.run(function(info) {
morpheus.logger.info('Worker %s is running morpheus@%s in %s mode on port %d', process.pid, info.version, process.env.NODE_ENV || 'development', info.port);
});
var JSX = require('node-jsx').install();
var React = require('react');
var Homepage = React.createElement(require('./views/home.jsx'));
var template = require('./views/global.jsx');
module.exports = function(app){
app.get("/*", function(req, res){
res.send(React.renderToString(React.createElement(template, {path:req.url})))
});
}
'use strict'
var fs = require('fs')
var path = require('path')
var nodejsx = require('node-jsx').install({ extension: '.jsx' })
var App = require('./src/App')
App.getPages().forEach(function (fileName) {
var RootHTML = App.renderToString({ initialPath: fileName })
fs.writeFileSync(path.join(__dirname, fileName), RootHTML)
})