boilerplate-nutella
boilerplate-nutella copied to clipboard
React Redux Server-Side-Rendering with Razzle, Code-Splitting, SCSS and CSS Modules
It may be a good idea to set cache on the static files. ``` app.use(Express.static(process.env.RAZZLE_PUBLIC_DIR, { maxAge: 0 })); app.use((_, res, next) => { res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Methods', 'GET,POST,PUT,OPTIONS,PATCH,DELETE'); res.header('Access-Control-Allow-Headers', 'Content-Type,Authorization');...
Implement a non-www redirect feature on the server and give an option to choose between with `www`or not. Here an example: ``` ... function wwwRedirect(req, res, next) { if (req.headers.host.slice(0,...
`parseQueryString` function on `DataLoader` needs to be wrapped with `try-catch` expression.
Based on that issue https://github.com/jaredpalmer/razzle/issues/356 I found a way to change the `port` by using the `process.env`. ``` const getEnv = c => process.env[c]; const PORT = getEnv('PORT'); export default...
A good option is https://github.com/expressjs/compression ``` // Apply body Parser and server public assets and routes app.use(bodyParser.json()); app.use(bodyParser.urlencoded({ extended: true })); app.use((_, res, next) => { res.header('Access-Control-Allow-Origin', '*'); res.header('Access-Control-Allow-Methods', 'GET,POST,PUT,OPTIONS,PATCH,DELETE');...
At this moment, the `callApi` function is handling just url params and not **querystring** params.
Build folder is getting extremely larger because of the hot reload feature.
The server is not handling the missing files and are triggering the components `need` functions based on the current route.
### Changelog: - Removed sass/css-modules build config; - Added styled-components app startup config(server-side); - Converted sass/css-modules styles to styled-components.