hecks-serverless 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a65c39b9d453d4bf7f6b7283c8e897220e13852c
4
+ data.tar.gz: e4232bd78cabc0381e48fff8d348f89892fd0f67
5
+ SHA512:
6
+ metadata.gz: 47d8bc778fa21ecca7e056281f416796b9e927397d7377d78be839c3eba4a5ee57ee79abb0d6cb2095687e2c9c3beffe4fdb8a2b23949139bece552cebbd4644
7
+ data.tar.gz: 9f8c1afa9e443c8310bf6cdbd558719c964133952e23cdfbbc1bd49454419258d433ac467aaf4483d94ae20a2e0348dbd14867843b10094212b89d879f503b4e
@@ -0,0 +1,10 @@
1
+ resources_path = File.expand_path(File.dirname(__FILE__)) + '/../resources'
2
+
3
+ bash_script =
4
+ <<-BASH_SCRIPT
5
+ cp #{resources_path}/serverless.yml .
6
+ mkdir -p serverless
7
+ cp #{resources_path}/pizzas.js serverless
8
+ BASH_SCRIPT
9
+
10
+ puts `#{bash_script}`
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+ const exec = require('child_process').exec
3
+
4
+ module.exports.create = (event, context, callback) => {
5
+ var command = 'package/osx/app -m pizzas -c create -d \'' + JSON.stringify(event) + "'"
6
+
7
+ exec(command, (err, stdout, stderr) => {
8
+ if (err) { console.error(err); return }
9
+ var result = JSON.parse(stdout)
10
+ console.error(stderr)
11
+ const response = {
12
+ statusCode: Object.keys(result.errors).length > 0 ? 500 : 200,
13
+ body: { message: 'create command called on the pizzas module', input: event, result: result, errors: result['errors']}
14
+ };
15
+ callback(null, response);
16
+ });
17
+ };
@@ -0,0 +1,115 @@
1
+ # Welcome to Serverless!
2
+ #
3
+ # This file is the main config file for your service.
4
+ # It's very minimal at this point and uses default values.
5
+ # You can always add more config options for more control.
6
+ # We've included some commented out config examples here.
7
+ # Just uncomment any of them to get that config option.
8
+ #
9
+ # For full config options, check the docs:
10
+ # docs.serverless.com
11
+ #
12
+ # Happy Coding!
13
+
14
+ service: aws-nodejs # NOTE: update this with your service name
15
+
16
+ # You can pin your service to only deploy with a specific Serverless version
17
+ # Check out our docs for more details
18
+ # frameworkVersion: "=X.X.X"
19
+
20
+ provider:
21
+ name: aws
22
+ runtime: nodejs4.3
23
+
24
+ # you can overwrite defaults here
25
+ # stage: dev
26
+ # region: us-east-1
27
+
28
+ # you can add statements to the Lambda function's IAM Role here
29
+ # iamRoleStatements:
30
+ # - Effect: "Allow"
31
+ # Action:
32
+ # - "s3:ListBucket"
33
+ # Resource: { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "ServerlessDeploymentBucket" } ] ] }
34
+ # - Effect: "Allow"
35
+ # Action:
36
+ # - "s3:PutObject"
37
+ # Resource:
38
+ # Fn::Join:
39
+ # - ""
40
+ # - - "arn:aws:s3:::"
41
+ # - "Ref" : "ServerlessDeploymentBucket"
42
+
43
+ # you can define service wide environment variables here
44
+ # environment:
45
+ # variable1: value1
46
+
47
+ # you can add packaging information here
48
+ #package:
49
+ # include:
50
+ # - include-me.js
51
+ # - include-me-dir/**
52
+ exclude:
53
+ # - exclude-me.js
54
+ - spec/**
55
+ - tmp/**
56
+ - package/osx/**
57
+ functions:
58
+ # PIZZAS
59
+ pizzas.create:
60
+ handler: serverless/pizzas.create
61
+ pizzas.read:
62
+ handler: serverless/pizzas.read
63
+ pizzas.update:
64
+ handler: serverless/pizzas.update
65
+ pizzas.delete:
66
+ handler: serverless/pizzas.delete
67
+ # ORDERS
68
+ orders.create:
69
+ handler: serverless/orders.create
70
+ orders.read:
71
+ handler: serverless/orders.read
72
+ orders.update:
73
+ handler: serverless/orders.update
74
+ orders.delete:
75
+ handler: serverless/orders.delete
76
+
77
+ # The following are a few example events you can configure
78
+ # NOTE: Please make sure to change your handler code to work with those events
79
+ # Check the event documentation for details
80
+ # events:
81
+ # - http:
82
+ # path: users/create
83
+ # method: get
84
+ # - s3: ${env:BUCKET}
85
+ # - schedule: rate(10 minutes)
86
+ # - sns: greeter-topic
87
+ # - stream: arn:aws:dynamodb:region:XXXXXX:table/foo/stream/1970-01-01T00:00:00.000
88
+ # - alexaSkill
89
+ # - iot:
90
+ # sql: "SELECT * FROM 'some_topic'"
91
+ # - cloudwatchEvent:
92
+ # event:
93
+ # source:
94
+ # - "aws.ec2"
95
+ # detail-type:
96
+ # - "EC2 Instance State-change Notification"
97
+ # detail:
98
+ # state:
99
+ # - pending
100
+
101
+ # Define function environment variables here
102
+ # environment:
103
+ # variable2: value2
104
+
105
+ # you can add CloudFormation resource templates here
106
+ #resources:
107
+ # Resources:
108
+ # NewResource:
109
+ # Type: AWS::S3::Bucket
110
+ # Properties:
111
+ # BucketName: my-new-bucket
112
+ # Outputs:
113
+ # NewOutput:
114
+ # Description: "Description for the output"
115
+ # Value: "Some output value"
metadata ADDED
@@ -0,0 +1,47 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: hecks-serverless
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.7
5
+ platform: ruby
6
+ authors:
7
+ - Chris Young
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-04-12 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Hecks Serverless
14
+ email: chris@example.com
15
+ executables:
16
+ - hecks-serverless
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - bin/hecks-serverless
21
+ - resources/pizzas.js
22
+ - resources/serverless.yml
23
+ homepage: https://github.com/chrisyoung/hecks-serverless
24
+ licenses:
25
+ - MIT
26
+ metadata: {}
27
+ post_install_message:
28
+ rdoc_options: []
29
+ require_paths:
30
+ - lib
31
+ required_ruby_version: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '0'
36
+ required_rubygems_version: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ requirements: []
42
+ rubyforge_project:
43
+ rubygems_version: 2.6.10
44
+ signing_key:
45
+ specification_version: 4
46
+ summary: Run your domain without a server
47
+ test_files: []