Deploying Static Web App to AWS
By: Serverless Guru
Author: Ryan Jones
Date: 11/23/2018
Why?
Setting up a basic website can be time consuming. This template aims to cut that time down dramatically.
What?
Serverless makes it easy by leveraging a plugin called, Serverless Finch. Serverless Finch allows you to point the distrubutionFolder
property to where you production files live (e.g. dist/
or src/
).
How?
After you clone the repo and install the dependencies you can simply run npm run deploy <stage> <region>
and you will have a website up.
Commands:
-
Install--
npm install
-
Deploy--
npm run deploy <stage> <region>
(Ex:npm run deploy dev us-west-1
ornpm run deploy prod us-west-2
) -
Remove--
npm run remove <stage> <region>
(Ex:npm run remove dev us-west-1
ornpm run remove prod us-west-2
)
Examples
Once you have a basic website deploying using this template then you can expand any direction you choose. For instance, why not build an Angular app.
Angular Example:
Building/Deploying an Angular app is easy with the Angular CLI
and this template.
https://gist.github.com/30240d6785d53776aa861dcb7d05428c
React Example:
Building/Deploying a React app is easy with the create-react-app
CLI and this template.
https://gist.github.com/ae1e5558341080de084a9da67c09582c
Basic Website Example:
Building/Deploying a basic website is easy with this template. All you need to do is add your own html
, css
, and js
. Into the /public
directory and everything will be handled for you.
https://gist.github.com/b5fb99853c641540513f960644b62231
Call to action
If you like this template and want to see more content like this. Please give us a follow or shoutout on Twitter, Medium, Facebook, Instagram, or check out our courses at training.serverlessguru.com.
Author Information:
Ryan Jones
Founder & Lead Cloud Developer at Serverless Guru ryan@serverlessguru.com