Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# 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