Giter Club home page Giter Club logo

serverless-aws-starter's Introduction

Serverless Example w/ Webpack

Simple starter project setting up a single /healthCheck API endpoint that is resolved by a small but incredibly important Lambda function, which returns a status 200 and an object with a random Chuck Norris fact.

Installation / Setup

  1. Get an AWS account (I recommend the Free Tier)
  2. Set up a new admin user, to get an API key and a secret.
  3. Install the serverless CLI
  4. Configure it to use the admin user.
  5. Clone this repo, cd into it and npm i to install the dependencies
  6. Deploy the thing as-is, typing serverless deploy.

Testing the Lambda function

If the deployment was successful, you will see a URL. Something like:

endpoints:
  GET - https://[blabla].execute-api.[aws-region].amazonaws.com/dev/healthCheck

You can test that url in your browser or Postman, with curl or what have you. The response, if all went well, should look like this:

{
  "wisdom": "Chuck Norris once ate a whole cake before his friends could tell him there was a stripper in it."
}

If you see any errors, you most likely haven't set up your admin user correctly. Read the links back at steps 2 and 4.

Developing

Thanks to the webpack and babel config included, you can write proper ES.next code, including es6 modules, as you can see in handler.js.

Read the official serverless framework docs about how to use the serverless.yml file to set up your configuration and additional functions, including more REST endpoints (API Gateway) and resources like DynamoDB tables or S3 buckets etc.

Enjoy.

serverless-aws-starter's People

Contributors

batjko avatar

Watchers

 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.