This is a retake on Netlify's own demo, where this one is a bit more like the setup I myself prefer and am used to. Less magic (Parcel, Create React App) and less bundles: Just plain old Express with serverless-http. Tried to get Fastify and aws-fastify-lambda working, but to no avail. Maybe will return to those later.
Uses:
- Webpack 4 with various loaders
- React 16.13
- Babel 7
Assumes that you'll use Netlify, obviously.
There's not much magic going on here. You will need to manually (un)comment the client-side or server-side mode in src/index.jsx
.
Run yarn install
or npm install
.
- Install Netlify CLI with
yarn global add netlify-cli
ornpm install -g netlify-cli
- Login with
netlify login
- Setup Netlify project and point this code-base there
Switch to CSR mode first.
Use one of:
netlify dev
, oryarn start
/npm run start
Switch to SSR mode and run yarn deploy
or npm run deploy
.