GithubHelp home page GithubHelp logo

kidgodzilla / generator-express-lambda Goto Github PK

View Code? Open in Web Editor NEW
3.0 3.0 0.0 759 KB

A scaffolding tool to build an Express app quickly, for serverless deployment on AWS Lambda, using Claudia.js.

License: MIT License

JavaScript 95.40% HTML 4.60%
express lambda claudia yeoman

generator-express-lambda's Introduction

generator-express-lambda NPM version Build Status Dependency Status

A scaffolding tool to build an Express app quickly, for Serverless deployment to AWS Lambda, using Claudia.js.

It uses Yeoman to automatically generate a project with Express & Claudia.js, ready to deploy to AWS Lambda.

Generator Output

Dependencies

First, install Yeoman and generator-express-lambda using npm (we assume you have pre-installed node.js).

You'll also need awscli. This can be installed via brew: brew install awscli

Installation

To install, you'll need to globally install this package along with yo and claudia, if you don't already have it.

npm install -g yo claudia generator-express-lambda

About the AWS Free Tier & Pricing

The AWS Free Tier includes a million invocations for your Lambda apps per month. This should get you pretty far for hobby projects and development. You can find out more here: https://aws.amazon.com/free/

You can estimate your total cost of using AWS Lambda here: https://s3.amazonaws.com/lambda-tools/pricing-calculator.html

Getting your AWS Keys

To get your access key ID and secret access key

  1. Open the IAM console.
  2. From the navigation menu, click Users.
  3. Select your IAM user name.
  4. Click User Actions, and then click Manage Access Keys.
  5. Click Create Access Key.
  • Your keys will look something like this:
    • Access key ID example: AKIAIOSFODNN7EXAMPLE
    • Secret access key example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
    • Click Download Credentials, and store the keys in a secure location.

Important

Your secret key will no longer be available through the AWS Management Console; you will have the only copy. Keep it confidential in order to protect your account, and never email it. Do not share it outside your organization, even if an inquiry appears to come from AWS or Amazon.com.

Setting up your AWS Keys

Run the following from your terminal to create your default AWS configuration, if one does not exist:

aws configure

Alternatively, if you already have keys setup and wish to create keys specifically for claudia.js, run:

aws configure --profile claudia

This will create keys under the profile [claudia], and leave the rest of your keys in tact.

Creating a New Project

Make a new directory for your project, and navigate into it.

mkdir <project-name>
cd <project-name>

Then generate your new project (from inside your new project directory):

yo express-lambda

This will create a ready-to-deploy Express application you can start your project from. It includes minimal dependencies to run your project locally, and deploy using Claudia.js.

Deploying your Project

When you are ready to deploy your project, run the following:

npm run deploy

Updating your Project

After deployment, to update your project, run:

npm run update

Where are my logs?

Logs from Lambda functions will appear in your AWS CloudWatch console. You can find your logs here: https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#logs:

To make things easier, you can run the following command:

npm run logs

You may have to tweak the value in package.json if the generated command filters for the wrong name.

About Yeoman Generator

Getting To Know Yeoman

  • Yeoman has a heart of gold.
  • Yeoman is a person with feelings and opinions, but is very easy to work with.
  • Yeoman can be too opinionated at times but is easily convinced not to be.
  • Feel free to learn more about Yeoman.

License

MIT

generator-express-lambda's People

Contributors

kidgodzilla avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

generator-express-lambda's Issues

Pick AWS region during setup

Currently always scaffolds projects to us-east-1 (which is fine, if you're in North America). Ideally, this would be a Yeoman question after project name.

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.