Created
December 2, 2018 06:31
-
-
Save tolmasky/870b05106a847ab2af5c3e91ef0dd7c9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Endpoint | |
## Export "endpoint" | |
| plugin | `@lithograph/http-response` | | |
|-----------------------------|---------------| | |
```javascript | |
const page = await (await getBrowserContext()) | |
.open.and.login("default-user"); | |
await page.goto.runkit.notebook.new(); | |
await page.notebook.cell(0).type( | |
`module.exports.endpoint = (_, response) => response.end('OK!');`); | |
await page.notebook.wait.for.save(); | |
const endpointURL = page.notebook.endpointURL(); | |
expect(response.status).toBe(200); | |
expect(await response.text()).toBe("OK!"); | |
``` | |
> <b>plugin:</b> <b>@lithograph/http-response</b></td></b></summary> | |
> | |
> | key | value | | |
> |-----------------------------|---------------| | |
> | endpoint | `endpointURL` | | |
> | status | `200` | | |
> | **HEADERS** | | | |
> | x-powered-by | runkit.com | | |
> | runkit-rate-limit-remaining | `PRESENT` | | |
> | **BODY** | | | |
> | text | OK! | | |
| key | value | | |
|-----------------------------|---------------| | |
| endpoint | `endpointURL` | | |
| status | `200` | | |
| **HEADERS** | | | |
| x-powered-by | runkit.com | | |
| runkit-rate-limit-remaining | `PRESENT` | | |
| **BODY** | | | |
| text | OK! | | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment