GithubHelp home page GithubHelp logo

lgs / serverless-ruby Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stewartlord/serverless-ruby

0.0 2.0 0.0 6.32 MB

A Serverless Framework example using an AWS lambda which runs a Ruby function

Shell 0.04% JavaScript 0.02% Ruby 99.59% Roff 0.36%

serverless-ruby's Introduction

Serverless Ruby!

A Serverless Framework example using an AWS lambda which runs a Ruby function. Inspired by serverless-php.

This project demonstrates a few cool technlogies. Foremost is the amazing AWS Lambda. It's pretty exciting to see serverless architectures gaining adoption! Adding to the fun we have serverless, a framework for packaging and deploying across different providers including AWS, Google, and IBM. Also worth mentioning is the inclusion of Ruby. AWS Lambda supports a number of different languages natively, but Ruby is not one of them. Therefore we specially bundle the Ruby interpreter (courtesy of Traveling Ruby) and wrap it in a Node.js script which executes it as a binary.

Prerequsites

  1. npm install -g serverless
  2. Create a new user serverless in AWS Console, download the credentials.csv file and setup provider: https://www.youtube.com/watch?v=HSd9uYj2LJA

Install

serverless install --url https://github.com/stewartlord/serverless-ruby

Deploy Function

$ serverless deploy
Serverless: Packaging service...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service .zip file to S3 (7.21 MB)...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
..............
Serverless: Stack update finished...
Service Information
service: serverless-ruby
stage: dev
region: us-east-1
api keys:
  None
endpoints:
  GET - https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/dev/hello
functions:
  hello: serverless-ruby-dev-hello

Try It Out!

{
    "status": 200,
    "body": "\"Hello from Ruby\""
}
--------------------------------------------------------------------
START RequestId: e9f2de65-31bc-11e7-a576-c18c442d05f7 Version: $LATEST
END RequestId: e9f2de65-31bc-11e7-a576-c18c442d05f7
REPORT RequestId: e9f2de65-31bc-11e7-a576-c18c442d05f7	Duration: 126.52 ms	Billed Duration: 200 ms 	Memory Size: 1024 MB	Max Memory Used: 23 MB

serverless-ruby's People

Contributors

stewartlord avatar fr4ncis avatar

Watchers

James Cloos 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.