You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -10,16 +10,16 @@ Lightweight boilerplate project to setup a React 16 web application on AWS Lambd
10
10
- Universal app; server-side rendering with dynamic configuration context passed from backend to browser.
11
11
- Self-contained; no additional setup steps necessary other than running `npx sls deploy`.
12
12
- Lightweight; no mandatory `redux`, `react-router`, `sass`, `less` or any other 3rd party dependency for full flexibility.
13
-
- Full ES6/7/8/9/10 with latest JavaScript features supported using Babel 7 and Webpack 4.
13
+
- Full [TypeScript](https://www.typescriptlang.org/) support using Babel 7 and Webpack 4.
14
14
- Working [Jest](https://jestjs.io/) test environment.
15
15
16
-
[Looking for the TypeScript version of this boilerplate?](https://github.com/arabold/serverless-react-boilerplate/tree/typescript)
16
+
[Looking for the plain JavaScript version of this boilerplate?](https://github.com/arabold/serverless-react-boilerplate/)
17
17
18
18
## Overview
19
19
20
20
### How Does It Work?
21
21
22
-
The idea is that we use AWS Lambda to serve the dynamic part of our app, the server-side logic, and perform the server-side rendering. For all static data like images, stylesheets and even the app's `index.jsx` that is loaded in the browser, we use an S3 bucket for public hosting.
22
+
The idea is that we use AWS Lambda to serve the dynamic part of our app, the server-side logic, and perform the server-side rendering. For all static data like images, stylesheets and even the app's `index.tsx` that is loaded in the browser, we use an S3 bucket for public hosting.
23
23
24
24
This combination makes our app fast and incredibly scalable. AWS will spin up new Lambda instances once your number of users increases, handling even the largest spikes fully automatically, while incurring virtually no costs when your app isn't used. At the same time S3 provides a robust and fast platform for your static content so you don't have to waste your own computing resources.
25
25
@@ -61,8 +61,8 @@ The project is based on the [Serverless Framework](https://serverless.com) and m
61
61
62
62
Though we use the same source code for both the server-side and client-side rendering, the project will be packaged into two distinct bundles:
63
63
64
-
1. Backend code running on AWS Lambda. The main entry point is `./src/server/index.jsx`. The packaging is controlled by `webpack.server.config.js` and optimized for Node.js 12.
65
-
2. Frontend code hosted in an S3 bucket and loaded by the browser. Main entry point is `./src/browser/index.jsx`. It's packaged using the `webpack.browser.config.js`, optimized for web browsers. The output files will have their content hash added to their names to enable long term caching in the browser.
64
+
1. Backend code running on AWS Lambda. The main entry point is `./src/server/index.tsx`. The packaging is controlled by `webpack.server.config.js` and optimized for Node.js 12.
65
+
2. Frontend code hosted in an S3 bucket and loaded by the browser. Main entry point is `./src/browser/index.tsx`. It's packaged using the `webpack.browser.config.js`, optimized for web browsers. The output files will have their content hash added to their names to enable long term caching in the browser.
66
66
67
67
## Customization
68
68
@@ -72,7 +72,7 @@ Update the `serverless.yaml` with your project name and additional resources you
72
72
73
73
### Configuration
74
74
75
-
The frontend as well as the server-side code running on AWS Lambda share a common application configuration. Currently it is used for injecting the application name from the `public/manifest.json` as well as setting the public host names. You can extend the configuration by adding your own variables to `src/server/config.jsx`. They will become available in both your backend and frontend code via the `useConfig` hook:
75
+
The frontend as well as the server-side code running on AWS Lambda share a common application configuration. Currently it is used for injecting the application name from the `public/manifest.json` as well as setting the public host names. You can extend the configuration by adding your own variables to `src/server/config.tsx`. They will become available in both your backend and frontend code via the `useConfig` hook:
0 commit comments