Skip to content

Conversation

@efekrskl
Copy link
Contributor

Adds a generic HTTP adapter for making a POST request at a target URL after new listings are found.

My use case would be to have an endpoint, that I can make a request to when new listings are found. This way the user could create long-running servers, or serverless functions to do additional operations.

method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${authToken}`,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes sense to make the auth optional, don't you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, definitely the right call. I've made the changes

endpointUrl: {
type: 'text',
label: 'Endpoint URL',
description: "'Your application's endpoint URL.",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A typo. You have one ' too much :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, fixed!

@@ -0,0 +1,31 @@
### HTTP Adapter

This is a generic adapter for sending notifications via HTTP requests.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're not mentioning the auth token here. I'd make it optional, but describe how to use it in any case. Note, not all users are pro's ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've improved the docs a bit 👍

type: 'text',
},
authToken: {
description: "Your application's auth token, if required by your endpoint.",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge it this time, but in the future, please make sure to install the pre-commit hooks. If you do, it would have told you that double quotes are not allowed. I'll fix this later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This string has a single quote inside, therefore it doesn't raise any issues. This is how similar usages are handled (e.g. lib/notification/adapter/telegram.js:122)

@orangecoding orangecoding merged commit 1b2fc79 into orangecoding:master Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants