
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
@fiquu/lambda-http-event-handler
Advanced tools
Lambda event handler for API Gateway HTTP requests.
npm i @fiquu/lambda-http-event-handler
This will generate the necessary objects to handle an HTTP request graciously:
/api/my-path/handler.ts
import { noContent } from '@fiquu/lambda-http-event-handler/responses';
import { createHTTPEvent } from '@fiquu/lambda-http-event-handler';
import { createLogger } from '@fiquu/logger';
import config from '../../configs/http-event';
const log = createLogger('HTTP /api/my-path');
export default function handler(event: APIGatewayProxyEvent): APIGatewayProxyResult {
const { req, res } = createHTTPEvent(event);
console.log(req.headers);
console.log(req.params);
console.log(req.query);
console.log(req.body);
try {
res.send(noContent());
} catch (err) {
log.error('It failed...', { err });
res.handle(err);
}
}
/configs/http-event.ts
import { StaticFileHandlerConfig } from '@fiquu/lambda-http-event-handler/statics';
const config: StaticFileHandlerConfig = {
res: {
nonce: true,
views: {
basedir: join(__dirname, '..', 'fixtures', 'views'),
locals: {}
}
}
};
export default config;
/api/my-path/handler.ts
import { noContent } from '@fiquu/lambda-http-event-handler/responses';
import { createHTTPEvent } from '@fiquu/lambda-http-event-handler';
import { createLogger } from '@fiquu/logger';
import config from './configs/http-event';
const log = createLogger('HTTP /view-path');
export default function handler(event: APIGatewayProxyEvent): APIGatewayProxyResult {
const { req, res } = createHTTPEvent(event, config);
try {
res.render('the-view', {
body: req.body
});
} catch (err) {
log.error('It failed...', { err });
res.render(err);
}
}
/configs/statics.ts
import { StaticFileHandlerConfig } from '@fiquu/lambda-http-event-handler/statics';
const config: StaticFileHandlerConfig = {
basedir: join('..', 'static')
};
export default config;
/statics/handler.ts
import { createStaticFileHandler, StaticFileHandler } from '@fiquu/lambda-http-event-handler/statics';
import config from '../configs/statics';
const staticFileHandler: StaticFileHandler = createStaticFileHandler(config);
export default function handler(event: APIGatewayProxyEvent): Promise<APIGatewayProxyResult> {
return staticFileHandler.get(event);
}
FAQs
fiquu project template.
The npm package @fiquu/lambda-http-event-handler receives a total of 1 weekly downloads. As such, @fiquu/lambda-http-event-handler popularity was classified as not popular.
We found that @fiquu/lambda-http-event-handler 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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.