Can NodeJS fs module access the Network drives of another computer connected via LAN/Ethernet

116
February 02, 2020, at 08:00 AM

I am running my NodeJS App(Express application) on a Raspberry pi. I am able to access the Application/website on another computer connected via Lan/Ethernet with the Raspberry pi by going to it's(pi) IP address(WLAN) followed by the port number on a browser(chrome). Since both are connected to the same wifi.

  1. I want to know can I access the website by simply going to the IP Address(Eth) of the pi to make sure it works even if there's no internet connection.
  2. I wanted to know if the node app running on Raspberry pi can access the network drives or any folders of the connected computer with the help of the FS module.

Thanks,

Answer 1

I want to know can I access the website by simply going to the IP Address(Eth) of the pi to make sure it works even if there's no internet connection.

Yes. If the IP address of the Pi computer is accessible from whatever computer you're on (on the same network), then you can access the web server on the Pi using the IP address.T

I wanted to know if the node app running on Raspberry pi can access the network drives or any folders of the connected computer with the help of the FS module.

The fs module should be able to see any network drive that you can see from the Pi terminal. In other words, the fs module supports whatever the host OS is configured to support. You will have to see if your Pi is configured to see the network drives you want to see or not.

To see Windows shared drives, you will likely need SAMBA support installed and configured on the Pi. See https://www.raspberrypi.org/documentation/remote-access/samba.md for more info.

READ ALSO
API server on Heroku & NameCheap

API server on Heroku & NameCheap

I have a simple app, api serverI installed the app on Heroku and everything works fine

143
How to fix troubles with Nodemailer settings

How to fix troubles with Nodemailer settings

I'm trying to write script which send form data to emailI try to use Express and Nodemailer with node js

116