Cannot GET /test.txt Why can't my node-red recognize the static file and download it from the browser

I've placed a file in Node-red's further directory, for example, it's test.txt, but I can't finish downloading it in the browser via http://localhost:1880/test.txt

image

image

root@dragino-3e1a15:~/.node-red# ls
lib node_modules package.json settings.js static test.txt
root@dragino-3e1a15:~/.node-red# node-red
17 Oct 12:23:34 - [info]

Welcome to Node-RED

17 Oct 12:23:34 - [info] Node-RED version: v3.0.2
17 Oct 12:23:34 - [info] Node.js version: v12.22.9
17 Oct 12:23:34 - [info] Linux 5.15.43-draginohp0z arm LE
17 Oct 12:23:39 - [info] Loading palette nodes
17 Oct 12:23:45 - [info] Settings file : /root/.node-red/settings.js
17 Oct 12:23:45 - [info] Context store : 'default' [module=memory]
17 Oct 12:23:45 - [info] User directory : /root/.node-red
17 Oct 12:23:45 - [warn] Projects disabled : editorTheme.projects.enabled=false
17 Oct 12:23:45 - [info] Flows file : /root/.node-red/flows.json
17 Oct 12:23:45 - [info] Creating new flow file
17 Oct 12:23:45 - [warn]


Your flow credentials file is encrypted using a system-generated key.

If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.

You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

17 Oct 12:23:45 - [warn] Encrypted credentials not found
17 Oct 12:23:45 - [info] Server now running at http://127.0.0.1:1880/
17 Oct 12:23:45 - [info] Starting flows
17 Oct 12:23:45 - [info] Started flows

Welcome to the forum @xiaoye

Have you set httpStatic in .node-red/settings.js? See Configuration : Node-RED

Many thanks, I get it.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.