GithubHelp home page GithubHelp logo

kyunghoon / serverless-client-s3 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kevzettler/serverless-client-s3

0.0 2.0 0.0 36 KB

A plugin to deploy front-end assets to S3 via the Serverless Framework

Home Page: http://www.serverless.com

JavaScript 100.00%

serverless-client-s3's Introduction

serverless-client-s3

serverless gitter version downloads dependencies license

A Serverless plugin that deploys a web client for your Serverless project to an S3 bucket, and make it publicaly available in seconds.

First, install:

npm install --save serverless-client-s3

Second, update serverless.yml by adding the following:

plugins:
  - serverless-client-s3
 custom:
   client:
     bucketName: whatsbertdoing-client
     distPath: overrides-client-path (default being client/dist)
     CacheControl:
       value: max-age=0
       regex: index.html$
  • Warning: The plugin will overwrite any data you have in the bucket name you set above if it already exists.

Third, Create a client/dist folder in the root directory of your Serverless project. This is where your distribution-ready website should live. It is recommended to have a client/src where you'll be developing your website, and a build script that outputs to client/dist. The plugin simply expects and uploads the entire client/dist folder to S3, configure the bucket to host the website, and make it publicly available.

Or just copy/run the following commands in the root directory of your Serverless project to get a quick sample website for deployment:

mkdir -p client/dist
touch client/dist/index.html
touch client/dist/error.html
echo "Go Serverless" >> client/dist/index.html
echo "error page" >> client/dist/error.html

Fourth, run the plugin, and visit your new website!

serverless client deploy [--stage $STAGE] [--region $REGION] -[--zipPattern $ZIPPATTERN]

Fifth, Have fun!

serverless-client-s3's People

Contributors

ac360 avatar ar90n avatar berndwessels avatar blakecohen91 avatar eahefnawy avatar keremtiryaki avatar kevzettler avatar nikordaris avatar pmuens avatar rattrayalex avatar s0enke avatar timheckel avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.