Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
HTML node? #38
This is more for discussion than anything . I think a node that would allow you to deploy a HTML page would finish the loop from hardware/software. Maybe allowing the node to just have you paste your HTML directly into a text area and as with the http posts select a subdirectory/file name e.g server/topic/name.HTML format. However I know this then would spark the argument for other languages etc but at the very least it would allow you to link a http post node to a HTML form and easily pass the form output which could then be stored in the mongodb etc.
Anyway just an idea for now. It could allow me to totally ditch my lighttpd server.
We already have an http node for just this sort of thing.
Assuming you're running a recent extract from git, rather than npm install, then import (Ctrl-I) the following:
Then, browse to http://localhost:1880/hello (ie whatever base url you access the UI from, with /hello appended).
In the example above, a template node between the two simple inserts some static content - which could be a complete HTML file. Okay for simple things, but I wouldn't want to use it to serve an entire site - all the content would be embedded in your flows file.
Alternatively, if you're comfortable with Node.js, you can embed node-red and run whatever express apps you want along side it for serving content. The docs at that link shows how to embed node-red within an express app that also serves static files from a local directory.
Finally, worth noting we do now have a Google Group for this sort of question/discussion - https://groups.google.com/forum/#!forum/node-red