
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
api-getaway-testing
Advanced tools
api-getaway testing server
const assert = require('assert');
const supertest = require('supertest');
const apiGetway = require('api-getaway-testing');
const api = apiGetway({
'/test':(event, ctx, cb) => {
assert(event.queryStringParameters);
assert(event.pathParameters);
assert(event.headers);
assert(event.body.test === 'test');
assert(event.httpMethod);
assert(event.path);
assert(event.requestContext);
assert(event.stageVariables);
cb(null, {
statusCode:202,
body:'response',
headers:{
'Content-Type':'application/text'
}
});
},
'/test/other/:params':{
post: (event, ctx, cb) => {
assert(event.queryStringParameters.query === 'query');
assert(event.pathParameters.params === 'params');
assert(event.headers);
assert(event.body.data === 'data');
assert(event.httpMethod === 'POST');
assert(event.path === '/test/other/params');
assert(event.requestContext);
assert(event.stageVariables);
cb(null, {
statusCode:201,
body: { response:'response' },
headers:{
'Content-Type':'application/json'
}
});
}
}
}, 4000);
const agent = supertest(api);
const res = await agent.get('/test')
.send({test:'test'})
.expect(202);
assert(res.text === 'response');
const res = await agent.post('/test/other/params')
.query({ query:'query' })
.send({ data:'data' })
.expect(201);
assert.deepEqual(res.body, { response :'response' });
assert(res.headers['content-type'] === 'application/json; charset=utf-8');
Receive a object what is a map between path and lambda handler:
{
path: handler
}
or
{
path: {
method: handler,
otherMethod: otherHandler
}
}
You can pass a express instance with all middleware already attached.
The only middleware attached by getApiGetawayTesting is body-parser.
FAQs
module to test the api-getaway lambda integration
We found that api-getaway-testing 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.