Ghost
New
flaxo
/
ghost
public
forked from
ghost/ghost
Source code of Ghost - On Ghost
Star
0
Fork
0
Code
Issues
0
Pull requests
0
78d856c
34
branches
Go to file
t
Code
ghost
docker
test
hooks.mjs
self-hosting: end-to-end test of a fresh install, run on every push to main
b39a7e0
12 days ago
13 lines · 487 B
1
//
Webhook receiver for e2e.mjs: keeps every delivery and lists them on GET /deliveries.
2
import
{
createServer
}
from
3
4
const
deliveries
=
[]
5
createServer
(
(
req
,
res
6
if
(
req
.
method
7
const
chunks
=
8
req
.
on
(
'
data
9
req
.
on
(
'
end
10
deliveries
.
push
(
{
11
res
.
end
(
'
ok
12
}
)
;
13
}
)
.
listen
(
8080
)
;
'
node:http
'
;
;
)
=>
{
===
'
GET
'
)
return
res
.
end
(
JSON
.
stringify
(
deliveries
))
;
[]
;
'
,
(
chunk
)
=>
chunks
.
push
(
chunk
))
;
'
,
()
=>
{
headers
:
req
.
headers
,
body
:
Buffer
.
concat
(
chunks
)
.
toString
(
'
base64
'
)
}
)
;
'
)
;