Created
July 10, 2018 17:48
-
-
Save elmasse/d023424b5d4e2b3024fd5678a17e3789 to your computer and use it in GitHub Desktop.
build-test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": ["env"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright 2017 Wireline, Inc. | |
// | |
// Enable source map support. | |
// https://github.com/evanw/node-source-map-support#programmatic-usage | |
import 'source-map-support/register'; | |
import Wireline from '@wirelineio/sdk'; | |
module.exports = { | |
test: Wireline.exec(async (event, context, response) => { | |
let { name='Alice' } = event.queryStringParameters || {}; | |
response.send({ | |
message: `Hello ${name}` | |
}); | |
}) | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "service-template", | |
"version": "0.0.1", | |
"description": "Wireline Test Service.", | |
"license": "UNLICENSED", | |
"repository": "https://github.com/wirelineio/service-template", | |
"devDependencies": { | |
"babel-cli": "^6.26.0", | |
"babel-loader": "^7.1.4", | |
"babel-polyfill": "^6.26.0", | |
"babel-preset-env": "^1.6.1", | |
"copy-webpack-plugin": "^4.5.1", | |
"webpack": "^3.11.0", | |
"zip-webpack-plugin": "^2.1.0" | |
}, | |
"dependencies": { | |
"@wirelineio/sdk": "0.0.1", | |
"source-map-support": "^0.5.4" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright 2017 Wireline, Inc. | |
# | |
name: service-template # Change me! | |
platform: nodejs | |
buildTool: webpack | |
version: 0.0.1 | |
functions: | |
test: | |
handler: handler.test | |
description: "Test service." | |
events: | |
- http: | |
path: test | |
method: get | |
cors: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright 2017 Wireline, Inc. | |
# | |
name: stack-template # Change me! | |
domain: example.com | |
stage: dev | |
provider: | |
name: aws | |
region: us-east-1 | |
stack: | |
my-deployment: | |
deployment: | |
image: wrn::service-template # Change me! | |
version: 0.0.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// Copyright 2017 Wireline, Inc. | |
// | |
const path = require('path'); | |
const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
const ZipPlugin = require('zip-webpack-plugin'); | |
module.exports = { | |
target: 'node', | |
stats: 'errors-only', | |
entry: { | |
handler: [ | |
'babel-polyfill', path.resolve('./handler.js') | |
] | |
}, | |
output: { | |
path: path.resolve('./dist'), | |
filename: '[name].js', | |
libraryTarget: 'commonjs2' | |
}, | |
// https://webpack.js.org/configuration/devtool/ | |
devtool: 'source-map', | |
plugins: [ | |
new CopyWebpackPlugin([ | |
'wireline.yml' | |
]), | |
new ZipPlugin({ | |
path: '../', | |
filename: 'webpack.zip' | |
}) | |
], | |
module: { | |
rules: [ | |
{ | |
test: /\.js$/, | |
exclude: /node_modules/, // Don't transpile deps. | |
use: { | |
loader: 'babel-loader', | |
options: { | |
cacheDirectory: './dist/babel-cache/' | |
} | |
} | |
} | |
] | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment