node-red / cookbook.nodered.org

Node-RED Cookbook
http://cookbook.nodered.org
Apache License 2.0
84 stars 34 forks source link

Feedback on 'Create an HTTP Endpoint' #96

Closed somersaultjump closed 3 years ago

somersaultjump commented 3 years ago

The example in this documentation is not working. https://cookbook.nodered.org/http/create-an-http-endpoint#example

I've imported the flow and ran exactly how it is shown here, an it results in a 404 each time.

It's worth noting that the current node shows that any URL is appended to "/endpoint", which is not referenced anywhere in the documentation. The request returns a 404 regardless if the "/endpoint" is present or not.

I'm not terribly familiar with node red, as I've only just started using it, so it's entirely possible I'm missing something.

somersaultjump commented 3 years ago

I'm running node red version 9.1.3

mblackstock commented 3 years ago

The latest version of node-red is 1.3.5. Perhaps you mean you are running node 9.1.3? If so, you may want to upgrade to a supported version.

I'm not sure what you mean when you say the "current node shows that any URL is appended to /endpoint". Have you changed your settings.js configuration file? Are you running node-red locally with a default configuration?

The URL that the flow creates is /hello. I've just tested it locally with a default configuration and it works for me.

knolleary commented 3 years ago

I'm running node red version 9.1.3

It sounds like you are running in home assistant, as 9.1.3 is not a Node-RED version we recognise, but I think that is the version of the NR add-on they produce.

It's worth noting that the current node shows that any URL is appended to "/endpoint"

The cookbook doesn't talk about that because the default Node-RED (not in HA) doesn't change the root path of the http in nodes.

somersaultjump commented 3 years ago

@knolleary Yes, this is correct, I am running Node-RED on Home Assistant. As I said, I've only just recently picked up Node-RED and clearly, I have some more research to do, specifically with how its implemented in HA.

Thank you both for the quick replies.