Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jfhbrook/pickleback

shot, except patched to work with express
https://github.com/jfhbrook/pickleback

Last synced: 3 days ago
JSON representation

shot, except patched to work with express

Awesome Lists containing this project

README

        

# ~~shot~~ pickleback

This is a patched version of [shot](https://github.com/hapijs/shot) that implements [an admittedly pretty gross fix](https://github.com/jfhbrook/pickleback/blob/patches/lib/index.js#L41-L48) so that it works with [express](https://expressjs.com) because [the shot team won't](https://github.com/hapijs/shot/issues/82).

Unlike the case with shot, this works:

```js
const assert = require('assert');

const express = require('express');
const pickleback = require('pickleback');

const app = express();

app.get('/', (req, res) => {

res.end('hello world!');
});

const main = async () => {

const res = await pickleback.inject(app, { url: '/' });
assert.equal(res.payload, 'hello world!');
}

main();

```

## API

APIs are almost identical to shot's, so [shot's docs](https://hapi.dev/family/shot) should be correct.