
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
api-deploy
Advanced tools
API Deploy publishes your Amazon Lambda functions and exports a JS SDK to use on the Web. Your SDK and Lambdas are both built based on the `config.json` that you supply.
API Deploy is a Command Line Tool to publish your API. Currently, AWS Lambda is implemented, with API Gateway on the way. You can also export an SDK to use on the Web or Node (more platforms to come). Your SDK and Lambdas are both built based your project's deployfile.js
.
First, you'll need to npm install api-deploy -g
. This gives you a new terminal command: api
. Now, create a deployfile.js
in your project:
var deployer = require('api-deploy').configure({
sdk: {
name: 'MyAPI',
url: 'http://myapi.com'
},
swagger: {
path: './swagger.json'
},
routes: require('./routes')
});
var pluginConfig = {
lambda: {
role: 'arn:aws:iam::xxxxxxxxxx:role/root'
},
aws: {
profile: config.aws.profile,
region: 'us-east-1',
IdentityPoolId: 'xxxxx'
}
};
require('api-deploy/plugins/local').register(deployer).configure(pluginConfig);
require('api-deploy/plugins/lambda').register(deployer).configure(pluginConfig);
require('api-deploy/plugins/apigateway').register(deployer).configure(pluginConfig);
module.exports = deployer;
api deploy apigateway
- Deploy your API Gateway to AWSapi deploy apigateway /accounts /other {operationId}
- Deploy selected API Gateway routes (also deploys child/ancestor routes)api deploy apigateway --sdk
- Deploy your API Gateway and generate a connected SDKapi deploy lambda
- Deploy your Lambdas to AWSapi deploy lambda /accounts /other {operationId}
- Deploy selected Lambdas (also deploys child/ancestor routes)api deploy lambda --sdk
- Deploy your Lambdas and generate a connected SDKAPI Deploy comes with a local hapi server that functions like your API Gateway:
api deploy local
- Saves a hapi server at ./local.js
api deploy local --serve --watch --sdk
- Test your Lambdas @ http://localhost:8000 and generate a connected SDK!api deploy local -sw --sdk
- A shortform of the aboveapi sdk lambda
- Build an SDK that points to your AWS Lambdas (saved at ./sdk-lambda.js
)!api sdk apigateway
- Build an SDK that points to your API Gateway (saved at ./sdk-apigateway.js
)!api sdk local
- Build a local server you can run with node local
(saved at ./sdk-local.js
)!api sdk local --prettify
- Build an SDK that is not minifiedMyAPI.init( new AWS.Lambda() ); // Only required if using the Lambda SDK
MyAPI.accountsCreate({
headers: {}, // HTTP Headers
query: {}, // URL Get Params (eg. /?param=123)
params: {}, // Dynamic URL segment params (eg. /accounts/{accountID})
payload: {} // eg. POSTed Data
}, function(err, data) {
console.log('Response from your API:', err, data);
});
https://github.com/dallasread/api-deploy/tree/master/example-api
FAQs
API Deploy publishes your Amazon Lambda functions and exports a JS SDK to use on the Web. Your SDK and Lambdas are both built based on the `config.json` that you supply.
The npm package api-deploy receives a total of 34 weekly downloads. As such, api-deploy popularity was classified as not popular.
We found that api-deploy 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.