An example project with TypeScript, Babel and Express for connecting to an SMB shared directory.
smbclient
(on Linux) or Docker (on macOS/Windows)- Node.js
npm i
npm run type-check
npm t
npm run build:js
Built code will be put in dist
folder.
Build JavaScript code, then run:
node dist
npm start
Build the Docker image:
npm run docker-build
Once the image is built, run:
npm run docker-start
The Docker image must be rebuilt on code changes!
Build the Docker image:
npm run docker-build-dev
Once the image is built, run:
npm run docker-start-dev
or (for "watch" mode):
npm run docker-watch
The Docker image can be reused on code changes (the repository is mounted as a volume).
Build the Docker image:
npm run docker-build-dev
Once the image is built, run:
npm run docker-bash
Build the Docker image:
npm run docker-build-dev
Once the image is built, run:
npm run docker-start-privileged-dev
That will run the Docker image with the --privileged
option, needed when mounting remote file systems in containers.
Then, mount SMB storage by executing mountSMBfs.sh
script (set environment variables first, see .env.sample
):
sh mountSMBfs.sh
SMB storage will be mounted to /mnt/smbstorage
.