https://github.com/rixrix/stencil-lambda
A horribly simple starter template for all your serverless development on AWS lambda w/ Apex, TypeScript & Webpack
https://github.com/rixrix/stencil-lambda
Last synced: 11 months ago
JSON representation
A horribly simple starter template for all your serverless development on AWS lambda w/ Apex, TypeScript & Webpack
- Host: GitHub
- URL: https://github.com/rixrix/stencil-lambda
- Owner: rixrix
- License: mit
- Created: 2016-08-02T05:07:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-03T13:21:07.000Z (over 9 years ago)
- Last Synced: 2025-01-23T05:15:17.326Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 10.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Stencil for [λ](https://aws.amazon.com/lambda/)
A horribly simple starter template for all your serverless development on [AWS lambda](https://aws.amazon.com/lambda/) w/ [Apex](http://www.apex.run), [TypeScript](http://www.typescriptlang.org/) & [Webpack](https://webpack.github.io/).
## Prerequisite
- [NodeJS](https://nodejs.org/en/download/current/) (at least 4.3) recommend 5.x or 6.x
- [Apex.run](http://www.apex.run)
- [Amazon Web Services account](https://aws.amazon.com/)
## How it works
### Deployment
Most of the time you will be interfacing with Apex command line utility from the build process, deployment
```
$> apex deploy
$> apex build
```
### Webpack build
The way Apex run is bit different than your usual NodeJS project.
Apex runs Webpack build command inside each `functions/` folder thus if you have the following directory structure
then Webpack gets invoked for `account/index.ts` and `users/index.ts`
```
functions/
L account/
index.ts
another-file.ts
L users/
index.ts
users-lib.ts
...
```
### Webpack configuration
The current webpack config file is minimal and pretty much everything inside is easy to understand however there's one
entry that is tightly coupled with Apex:
`webpack.config.js`
```
var distDir = './package';
output: {
path: distDir
}
...
```
`project.json`
```
{
"handler": "package.default"
}
```
The `package` output path from Webpack maps to the `handler` property in Apex.
## Note
> The Webpack config has been absurdly copied from Apex [example](https://github.com/apex/apex/tree/master/_examples/babel-webpack)
## License
MIT