Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@softchef/cdk-restapi
Advanced tools
This construct is base on @aws/aws-apigateway.RestApi.
The RestApi has addResource & addMethod function to create REST API routes. But the source code are low readability about what kind of resources and method in the API. So this construct are redefine the resources to improve readability.
npm install @softchef/cdk-restapi
// or
yarn add @softchef/cdk-restapi
const demoRestApi = new RestApi(stack, 'RestApiDemo', {
resources: [
{
path: '/articles',
httpMethod: HttpMethod.GET,
lambdaFunction: new lambda.NodejsFunction(stack, 'GetArticles', {
entry: `./lambda-assets/articles/get-articles/app.ts`,
}),
},
{
path: '/articles',
httpMethod: HttpMethod.POST,
lambdaFunction: new lambda.NodejsFunction(stack, 'CreateArticle', {
entry: `./lambda-assets/articles/create-article/app.ts`,
}),
},
{
path: '/articles/{articleId}',
httpMethod: HttpMethod.GET,
lambdaFunction: new lambda.NodejsFunction(stack, 'GetArticle', {
entry: `./lambda-assets/articles/get-article/app.ts`,
}),
},
{
path: '/articles/{articleId}',
httpMethod: HttpMethod.PUT,
lambdaFunction: new lambda.NodejsFunction(stack, 'UpdateArticle', {
entry: `./lambda-assets/articles/update-article/app.ts`,
}),
},
{
path: '/articles/{articleId}/comments',
httpMethod: HttpMethod.GET,
lambdaFunction: new lambda.NodejsFunction(stack, 'GetComments', {
entry: `./lambda-assets/articles/get-comments/app.ts`,
}),
},
{
path: '/articles/{articleId}/comments',
httpMethod: HttpMethod.POST,
lambdaFunction: new lambda.NodejsFunction(stack, 'CreateComment', {
entry: `./lambda-assets/articles/create-comment/app.ts`,
}),
},
],
enableCors: true,
});
// Add multi-resources
demoRestApi.addResources([
{
path: '/authors',
httpMethod: HttpMethod.GET,
lambdaFunction: new lambda.NodejsFunction(stack, 'GetAuthors', {
entry: `./lambda-assets/authors/get-authors/app.ts`,
}),
},
{
path: '/authors/{authorId}',
httpMethod: HttpMethod.GET,
lambdaFunction: new lambda.NodejsFunction(stack, 'GetAuthor', {
entry: `./lambda-assets/authors/get-author/app.ts`,
}),
}
]);
// Add single resource
demoRestApi.addResource({
path: '/authors',
httpMethod: HttpMethod.POST,
lambdaFunction: new lambda.NodejsFunction(stack, 'CreateAuthors', {
entry: `./lambda-assets/authors/create-authors/app.ts`,
}),
})
npx projen
cdk deploy --app lib/demo/demo.js
FAQs
Easy to manage Rest-API
The npm package @softchef/cdk-restapi receives a total of 84 weekly downloads. As such, @softchef/cdk-restapi popularity was classified as not popular.
We found that @softchef/cdk-restapi 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.