structure compatible with # API Gateway render json: {hello: "world", action: "index"} end def show # params available id = params[:id] # puts goes to the lambda logs puts event # raw lambda event available render json: {action: "show", id: id} end … end
get “posts/:id", to: "posts#show" post "posts", to: "posts#create" get "posts/:id/edit", to: "posts#edit" put "posts", to: "posts#update" delete “posts", to: "posts#delete" # expands to the RESTful routes above resources :posts # GET, POST, PUT, etc request all work any "posts/hot", to: “posts#hot” … end
current project directory to temporary build area: /tmp/ jets/demo/app_root => Setting up a vendored copy of ruby. => Replacing compiled gems with AWS Lambda Linux compiled versions. Deploying CloudFormation stack with jets app! Uploading /tmp/jets/demo/code/code-7169d0ac.zip (88.8 MB) to S3 Time to upload code to s3: 1s 02:08:20AM UPDATE_IN_PROGRESS AWS::CloudFormation::Stack demo-dev User Initiated ... 02:08:48AM CREATE_IN_PROGRESS AWS::CloudFormation::Stack PostsController 02:10:03AM UPDATE_COMPLETE AWS::CloudFormation::Stack demo-dev Stack success status: UPDATE_COMPLETE Time took for stack deployment: 1m 46s. Prewarming application... API Gateway Endpoint: https://xxxxxxxxxx.execute-api.us- west-2.amazonaws.com/dev/
structure compatible with # API Gateway render json: {hello: "world", action: "index"} end def show # params available id = params[:id] # puts goes to the lambda logs puts event # raw lambda event available render json: {action: "show", id: id} end … end
get “posts/:id", to: "posts#show" post "posts", to: "posts#create" get "posts/:id/edit", to: "posts#edit" put "posts", to: "posts#update" delete “posts", to: "posts#delete" … end