Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
sc5-serverless-boilerplate
Advanced tools
A REST API project template for serverless 0.5
sc5-serverless-boilerplate is a project template for new serverless projects. Contents of the template:
A new project based on the project template is initialized with the command
> sls project install -n myProjectName sc5-serverless-boilerplate
> cd myProjectName
> npm install
The REST endpoint templates can be used by refering to them in RequestTemplates in the endpoints section of the s-function file. For example (for an endpoint with GET method)
RequestTemplates: "$${restGet}"
When using the REST endpoint templates, the incoming event has the following structure:
{
"method": "GET/POST/PUT/DELETE/...",
"body": { ... payload sent by client ... }, (only in restPost and restPut)
"id": "identifier" (only in restPut and restDelete)
}
Add the following to the "custom" section of either s-components or s-function files.
"cors": {
"allowOrigin": "*",
"allowHeaders": ["Content-Type", "X-Amz-Date", "Authorization", "X-Api-Key"]
}
Deploy the endpoints (after deploying functions) inside the component folder using
sls endpoint deploy --all
Using this (instead of e.g. sls dash deploy) ensures that CORS headers (incl. the OPTIONS method required for CORS preflight) are created properly
(see https://github.com/joostfarla/serverless-cors-plugin)
To enabled optimization of Lambda function size, add the following to the "custom" section of either s-components or s-function files.
"optimize": true
(see https://github.com/serverless/serverless-optimizer-plugin)
Some resources (e.g. database tables, SNS topics, etc...) may be specific to the project and stage. The project name and stage name can be determined during runtime using
process.env.SERVERLESS_PROJECT_NAME (for the project name)
process.env.SERVERLESS_STAGE (for the project stage)
Function test are created automatically when creating new functions into the test/ directory. See serverless-mocha-plugin for more info
Please see project GitHub issue tracker.
Copyright (c) 2016 SC5, licensed for users and contributors under MIT license. https://github.com/sc5/sc5-serverless-boilerplate/blob/master/LICENSE-MIT
FAQs
A REST API project template for serverless 0.5
We found that sc5-serverless-boilerplate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.