- JavaScript Cloud Native Development Cookbook
- John Gilbert
- 319字
- 2021-07-16 18:03:27
How it works...
The first thing to notice is that we are using all the same development tools for the full stack. This is one of many advantages of using JavaScript for backend development. A single, self-sufficient, full-stack team can develop the frontend application and the BFF service with the same programming language. This can allow for more efficient utilization of team resources.
There are two new standard scripts—start and build. npm start will run the frontend app locally using Node.js as the web server. npm run build will prepare the application for deployment. I used the react-scripts library so as not to clutter the example with a detailed ReactJS build process. This recipe uses a small, canned ReactJS example for the same reason. I wanted an app that was just large enough to have something to deploy. ReactJS is not the focus of this recipe or cookbook. There are volumes already written on ReactJS and similar frameworks.
We are creating an S3 bucket, WebsiteBucket, and configuring it as a website. The stack output displays the WebsiteUrl used to access the SPA. The SPA will be served from a bucket with no need for servers whatsoever. In this context, we can think of S3 as a global web server.
We are using a Serverless plugin for the first time in this recipe. The serverless-spa-deploy plugin will upload the SPA files from the ./build directory after the stack is deployed. Note that we are not explicitly naming the bucket. CloudFormation will generate the name with a random suffix. This is important because bucket names must be globally unique. The plugin infers the generated bucket name. The plugin has sensible defaults that can be customized, such as to change the CacheControl headers for different files. The plugin also empties the bucket, before stack removal.
- 小哥Cadence Allegro PCB軟件操作技巧260例(配視頻教程)
- App Inventor移動(dòng)應(yīng)用開(kāi)發(fā)標(biāo)準(zhǔn)教程
- 混沌同步控制方法及在保密通信中的應(yīng)用
- iOS游戲框架Sprite Kit技術(shù)詳解
- 電子裝配工藝實(shí)訓(xùn):項(xiàng)目教程
- 電子組裝先進(jìn)工藝
- IMS技術(shù)行業(yè)專(zhuān)網(wǎng)應(yīng)用
- 電工與電子技術(shù)技能訓(xùn)練
- 光通信技術(shù)與應(yīng)用
- 信號(hào)/電源完整性仿真分析與實(shí)踐
- Android App開(kāi)發(fā)從入門(mén)到精通
- 數(shù)聯(lián)網(wǎng):大數(shù)據(jù)如何互聯(lián)
- 分?jǐn)?shù)傅里葉變換原理及其在通信系統(tǒng)中的應(yīng)用
- Wireshark Essentials
- 5G安全技術(shù)與標(biāo)準(zhǔn)