You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Tom, very good job. I have two questions to improve my project:
How could I change the app.js code to send a file (example index.html, resources.html) instead of send a text (res.send()). I have tried to put sendFile(path/index.html) but nothing happens.
I have tried to change "pi.wifi" in this same file to put something diferent in URL but fails again. If I put "anotherthing.wifi" must I change the name of the service???
Thanks in advance for your project and time.
Pablo
The text was updated successfully, but these errors were encountered:
For your first point, you could set a folder to be served. This means any files you request via the URL, or by default index.html, will be returned by the nodejs application.
To serve up files in a folder called public within your nodejs folder you could write:
If you'd like to read more about that, the docs are here.
For your second point, I would have expected you'd only need to change the hostName variable in the nodejs code from pi.wifi to anotherthing.wifi. I'm not sure why that isn't working.
It has been a while since I worked on this guide, and I think the steps can be significantly simplified. This project appears to achieve a similar goal with less configuration. When I find a bit of free time I'd like to revisit it to see if I can reduce the setup complexity and automate some of it with scripts!
Thanks for the feedback and best of luck with your project!
Hi Tom, very good job. I have two questions to improve my project:
Thanks in advance for your project and time.
Pablo
The text was updated successfully, but these errors were encountered: