IT |
ITmedia 総合記事一覧 |
[ITmedia ビジネスオンライン] 淡路島にグランピング施設が誕生、特徴は? |
https://www.itmedia.co.jp/business/articles/2301/21/news048.html
|
itmedia |
2023-01-21 09:15:00 |
TECH |
Techable(テッカブル) |
川崎水族館でNFT作品を楽しめるイベントが2/28(土)まで開催!1/21(土)にはオフ会も |
https://techable.jp/archives/192035
|
verylongcnp |
2023-01-21 00:46:48 |
python |
Pythonタグが付けられた新着投稿 - Qiita |
アニーリングマシンにとても簡単な問題を解いてもらう |
https://qiita.com/ojiya/items/e6741a18abac265f8318
|
量子コンピュータ |
2023-01-21 09:58:05 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
論理和演算子( || )の短絡評価を利用した分岐Tips |
https://qiita.com/spiky/items/4588b4308b2753e0a87f
|
valuedeleterecordsidprop |
2023-01-21 09:43:57 |
js |
JavaScriptタグが付けられた新着投稿 - Qiita |
TypeScriptで多重extendsを具現する |
https://qiita.com/jungyeounjae/items/1ebe3188f7ac096d1b00
|
extends |
2023-01-21 09:28:15 |
Ruby |
Rubyタグが付けられた新着投稿 - Qiita |
【Ruby】catch/throwについて |
https://qiita.com/yamaBBB/items/4e10de2b074b92c6051d
|
catchthrow |
2023-01-21 09:37:09 |
AWS |
AWSタグが付けられた新着投稿 - Qiita |
AWS SAAを勉強するうえで引っかかったところや要メモのまとめ |
https://qiita.com/IYT-engineer/items/bf231a38edea1d7d6851
|
awssaa |
2023-01-21 09:50:00 |
海外TECH |
DEV Community |
Cook a Recipe: Create a Web application using AWS Amplify |
https://dev.to/aws-builders/cook-a-recipe-create-a-web-application-using-aws-amplify-3128
|
Cook a Recipe Create a Web application using AWS Amplify Static WebsiteA static website as in contrast to a typical dynamic website renders the webpage at the time of request and instead delivers pre built HTML CSS and JavaScript files to a web browser Now We are going to cook a simple static website using HTML and JavaScript which call the reverseStringCall api endpoint and Fetch the response get it displayed on our website IngredientLambda Function ReverseString Recipe Cook a recipe with AWS Simple and Easy Lambda FunctionsREST API endpoint that triggers the Lambda Function ReverseString created using API GatewayRecipe Cook a recipe with AWS A simple API using API Gateway Lets Jump to the recipe Create an HTML page that calls a Rest API endpoint built using API Gateway and displays the API ResponseCreate a java script file that calls the API endpoint from API Gateway fetch the result and get it displayed to HTML fileJavaScript is an extremely popular scripting language that may be used on both the client and the server Our websites require JavaScript because it makes them interactive Here We are going to add a JavaScript script code that makes an API call retrieves the response and displays it to the HTML formCopy the below code to a notepad and save it as main js form addEventListener submit function e Prevent default behavior e preventDefault Create new FormData object const formData new FormData form const formDataObject Object fromEntries formData entries Post the payload using Fetch fetch lt Invoke URL gt method POST body JSON stringify formDataObject then res gt res json then data gt log the response obtained to the browser console console log data call to the function displayToHTML displayToHTML data function displayToHTML data const form document getElementById form document getElementById demo innerHTML lt span gt Reversed String is data reversed string lt span gt Invoke URLWhen you deploy your API you deploy to a stage a base URL is generated which is also called as the invoke URLAll APIs created with API Gateway will follow the same pattern as the invoke URL above with the ID of the API and the Region in which it was created followed by a stage and then the resource and resource path you want to expose fetch lt Invoke URL gt Here we have to specify the Invoke URL obtained from API GatewayCreate a CSS stylesheet file to beautify and format the html file CSS allows you to customize the color font text size spacing between elements how elements are positioned and laid out what background images or background colors are to be used different displays for different devices and screen sizes and much more Here We are going to create an external style sheet with which you can change the look of an entire website by changing just one file Copy the below code to the notepad and save it as main cssbody background color FFFFFF label button color font family Arial Helvetica sans serif font size px margin left px input color BFFF font family Arial Helvetica sans serif font size px margin left px p color font family Arial Helvetica sans serif font size px margin left px Create an HTML page that calls a Rest API endpoint Link the CSS and JS files to it I am going to create a simple html page with a Text field which accepts the input string that needs to be reversed and a Submit button Open your favorite text editor on your computer Create a new file and paste the following HTML in it lt HTML form data gt lt html gt lt head gt lt title gt ReverseString Checker lt title gt lt Linking the css file gt lt link rel stylesheet href main css gt lt head gt lt body gt lt form id form gt lt label for Input gt Enter the String to be reversed lt label gt lt input name first name type text gt lt button type submit gt Submit lt button gt lt form gt lt p id demo gt lt p gt lt linking the js file gt lt script src main js gt lt script gt lt body gt lt html gt Yes Our webpage is ready Now lets get it deployed using AWS Amplify Deploy a website using AWS AmplifyNow we are going to deploy the above html file as a webapplication using AWS Amplify AWS AmplifyAWS Amplify is a set of products and tools that enable mobile and front end web developers to build and deploy secure scalable full stack applications powered by AWS IngredientThe above html file saved as index html PrerequisitesCompress the files index html main js and main css and keep it readyLog into AWS account with a valid user credentials Root user not preferred Steps to createOpen the AWS Amplify service from aws consoleClick Get Started buttonNow Click Get Started button under Host your web app section as we have already created the resources such as html css and js files and we just need to deploy themNow you will be navigated to Get started with Amplify Hosting page Select without GIT Provider option because we have saved the files local system and click Continue button Note GIT is a source code management system and we are not using it for this cooking this recipe nowYou will be navigated to Manual Deploy Page Specify the App name Environment name Drag and drop option will be selected by default for Method Leave it as it isHere we are going to drag and drop our zipped file Click Choose File and Select the Zipped folder Make sure the folder name is correct Click Save and DeployA deployment process will automatically beginNow wait for a couple of minutes and You will see a green bar which indicates your deployment is completedYou can also see the application url link below DomainLaunch the Application Click on the application url link and launch the web applicationYaay Our application is ready Now Give some input string and click Submit button See Reversed version of your string is displayed on the WebsiteView the Network Tab browser console and ensure if the api endpoint called and response is generated Right click on the webpage and click on Inspect option to launch the browser console and network tabsClick Network and get into the Network tabClick Submit button and observe the Network tab You can see the api endpoint getting called once you click the submit button and JSON Response is getting generatedClick the Payload and observe the data sent as the input to the lambda function which is being triggered using APIClick the Console and come to Console TabYou can see that the Response is getting displayed on console as per our JavaScript codeCode snippet from main js below log the response obtained to the browser console console log data |
2023-01-21 00:14:35 |
ニュース |
BBC News - Home |
NHS England boss: Repeated strikes make workload more challenging |
https://www.bbc.co.uk/news/health-64354661?at_medium=RSS&at_campaign=KARANGA
|
action |
2023-01-21 00:48:28 |
ニュース |
BBC News - Home |
Stagecoach co-founder charged with human trafficking |
https://www.bbc.co.uk/news/uk-scotland-64355631?at_medium=RSS&at_campaign=KARANGA
|
human |
2023-01-21 00:05:13 |
ニュース |
BBC News - Home |
Rishi Sunak fined for not wearing seatbelt in back of car |
https://www.bbc.co.uk/news/uk-politics-64353054?at_medium=RSS&at_campaign=KARANGA
|
rishi |
2023-01-21 00:53:50 |
ニュース |
BBC News - Home |
Mental health: NHS crisis lines failing to answer suicide calls |
https://www.bbc.co.uk/news/uk-64235372?at_medium=RSS&at_campaign=KARANGA
|
calls |
2023-01-21 00:49:49 |
ニュース |
BBC News - Home |
The Papers: Rishi's 'fine mess' and coronation clothes change |
https://www.bbc.co.uk/news/blogs-the-papers-64355769?at_medium=RSS&at_campaign=KARANGA
|
minister |
2023-01-21 00:19:14 |
ビジネス |
プレジデントオンライン |
「Fランク大学の無償化は税金の無駄」ひろゆきが共通テスト高得点者の学費をタダにすればいいと考えるワケ - どんなランクでも大学には行ったほうがいい |
https://president.jp/articles/-/65656
|
大学無償化 |
2023-01-21 10:00:00 |
ビジネス |
プレジデントオンライン |
エリザベス女王のような国葬には絶対にならない…「安倍元首相の国葬」が国民をシラけさせている根本原因【2022下半期BEST5】 - 弔意はそっちのけで思想信条の"踏み絵"になっている |
https://president.jp/articles/-/65528
|
安倍元首相 |
2023-01-21 10:00:00 |
コメント
コメントを投稿