// style.scss
.header {
padding: 3px;
background: #fff;
box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 10px,
rgba(0, 0, 0, 0.23) 0px 3px 10px;
h1 {
margin: 0;
text-align: center;
}
}
// app.css
.style-scss {
padding: 3px;
background: #fff;
box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 10px, rgba(0, 0, 0, 0.23) 0px 3px 10px; }
.style-scss h1 {
margin: 0;
text-align: center; }
...
ReferenceError: window is not defined
...
const app = express();
function handleRender(req, res) {
let preloadedState = {}
const store = createStore(rootReducer, preloadedState);
const html = renderToString(
<Provider store={store}>
<div className="main-container clearfix">
<Main/>
</div>
</Provider>
);
const finalState = store.getState();
res.send(renderFullPage(html, finalState))
}
app.use('/assets', express.static('./src/assets'));
app.use('/dist', express.static('./dist'));
app.use(handleRender);
const port = 3008;
app.listen(port);
console.log(`Listening on port ${port}`);
"react": "^16.0.0",
"redux": "^3.7.2",
"express": "^4.16.2",
var request = require('request');
function dataLoad() {
var data;
return request('http://fake-url.com/param=param', function (error, response, body) {
return body
});
}
exports.func = dataLoad;