Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/jfhbrook/pickleback
- Owner: jfhbrook
- License: other
- Created: 2016-09-19T23:57:15.000Z (about 8 years ago)
- Default Branch: patches
- Last Pushed: 2022-01-30T22:28:20.000Z (almost 3 years ago)
- Last Synced: 2024-10-18T21:01:18.111Z (20 days ago)
- Language: JavaScript
- Size: 245 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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.