Tony Yuen
8 years ago
7 changed files with 99 additions and 0 deletions
@ -0,0 +1,5 @@ |
|||
{ |
|||
"key3": "value3", |
|||
"key2": "value2", |
|||
"key1": "value1" |
|||
} |
@ -0,0 +1,8 @@ |
|||
'use strict'; |
|||
|
|||
var AWS = require('aws-sdk'); |
|||
var fbgraph = require('fbgraph'); |
|||
|
|||
module.exports.hello = function (event, context, cb) { |
|||
cb(null, { message: 'hello fb & aws', event }); |
|||
} |
@ -0,0 +1,19 @@ |
|||
{ |
|||
"name": "serverless-include-external-npm-package", |
|||
"version": "1.0.0", |
|||
"description": "Serverless webpack example", |
|||
"main": "handler.js", |
|||
"scripts": { |
|||
"test": "echo \"Error: no test specified\" && exit 1" |
|||
}, |
|||
"author": "Tony Yuen <colsy2@gmail.com>", |
|||
"license": "MIT", |
|||
"devDependencies": { |
|||
"serverless-webpack": "^1.0.0-beta.2", |
|||
"webpack": "^1.13.1" |
|||
}, |
|||
"dependencies": { |
|||
"aws-sdk": "^2.5.3", |
|||
"fbgraph": "^1.3.0" |
|||
} |
|||
} |
@ -0,0 +1,15 @@ |
|||
# This is the Serverless Environment File |
|||
# |
|||
# It contains listing of your stages and their regions |
|||
# It also manages serverless variables at 3 levels: |
|||
# - common variables: variables that apply to all stages/regions |
|||
# - stage variables: variables that apply to a specific stage |
|||
# - region variables: variables that apply to a specific region |
|||
|
|||
vars: |
|||
stages: |
|||
dev: |
|||
vars: |
|||
regions: |
|||
us-east-1: |
|||
vars: |
@ -0,0 +1,21 @@ |
|||
service: serverless-webpack-multiple-entries-example |
|||
|
|||
# Add the serverless-webpack plugin |
|||
plugins: |
|||
- serverless-webpack |
|||
|
|||
provider: |
|||
name: aws |
|||
runtime: nodejs4.3 |
|||
|
|||
custom: |
|||
includePackages: # packages to be included in distribution |
|||
- fbgraph |
|||
|
|||
functions: |
|||
first: |
|||
handler: handler.hello |
|||
events: |
|||
- http: |
|||
method: GET |
|||
path: first |
@ -0,0 +1,7 @@ |
|||
var path = require('path'); |
|||
|
|||
module.exports = { |
|||
entry: './handler.js', |
|||
target: 'node', |
|||
externals: ["fbgraph", "aws-sdk"] // packages to be excluded from bundled file
|
|||
}; |
Loading…
Reference in new issue