Skip to content

Instantly share code, notes, and snippets.

/**
* This is the test file that is run by Jest.
* It has the (single) setup for the actionhero instance
*/
import { Process, env, id, specHelper } from 'actionhero'
import createTests from './lib/create'
import updateTests from './lib/update'
const actionhero = new Process()
let api
@chimmelb
chimmelb / QuantumAction.ts
Created June 30, 2020 16:19
Error Handling Pattern for actionheroJS
import { Action, ActionProcessor, log } from 'actionhero'
import { SmartError } from './SmartError'
export abstract class QuantumAction extends Action {
constructor() {
// extends Abstract class Action only to wrap
super()
}
async run(data: ActionProcessor): Promise<void> {
try {
'use strict'
import { Initializer, api, action, log } from 'actionhero'
let compression = require('compression')
export class CompressMiddleware extends Initializer {
constructor() {
super()
this.name = 'CompressMiddleware'
this.loadPriority = 1000
this.startPriority = 1000
@chimmelb
chimmelb / chromiumpackages.config
Last active April 4, 2024 16:07
.ebextensions config file to load NodeJS EB instance with packages needed for Puppeteer/Chromium
# This is for ElasticBeanstalk with Amazon Linux 2023. For previous Linux 2 or Linux 1, see revisions for ideas
packages:
yum:
cups-libs: []
libdrm: []
libXdamage: []
libXfixes: []
libXrandr: []
mesa-libgbm: []
libxkbcommon: []