官术网_书友最值得收藏!

Viewing the deployed web application

With everything in place, we can now upload our frontend assets to S3. We won't review the actual frontend React code, but if you're curious, you can take a look at that UI code in the GitHub repository at https://github.com/brianz/serverless-design-patterns/tree/master/ch2/ui.

Using the preceding aws s3 cp command, a final production build of the frontend code is uploaded to S3 and ultimately serves the content as requested by the CloudFront CDN. When the first page is rendered, a request is made to our serverless backend to get a listing of all coffee cupping sessions:

A very common issue, and one that people often forget about, is cross-origin resource sharing, which is a security measure put in place by browsers. Our serverless backend was set up to sidestep this issue, making development much quicker. For a real production system, it's best to only allow CORS for your own domain or, better yet, run the serverless backend on your own domain rather than the autogenerated domain from API Gateway. Running the serverless API on your own custom domain is possible using AWS API Gateway, but this is out of the scope of this chapter.

Clicking on a single row, the detail page for the particular session is loaded:

主站蜘蛛池模板: 金山区| 穆棱市| 连江县| 铁岭市| 光泽县| 汝城县| 武宣县| 亚东县| 汉阴县| 永登县| 白山市| 上犹县| 石台县| 和林格尔县| 景洪市| 玉田县| 象山县| 白城市| 霍州市| 临邑县| 安陆市| 合山市| 珠海市| 玛曲县| 新乐市| 呼图壁县| 临湘市| 法库县| 民乐县| 义马市| 三河市| 佛山市| 伊宁县| 潍坊市| 清原| 新邵县| 巫溪县| 塘沽区| 平谷区| 池州市| 宁晋县|