Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
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
The npm package sc5-serverless-boilerplate receives a total of 0 weekly downloads. As such, sc5-serverless-boilerplate popularity was classified as not popular.
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.