使用节点静态无法找到本地主机页面

Localhost page cannot be found using node-static

我正在尝试使用节点静态服务静态文件。后来我打算运行这个作为Windows服务使用nssm。我以前有 运行 这个,但不知道为什么,现在不起作用了。

下面是我的代码:

var http = require('http');

var nStatic = require('node-static');

var fileServer = new nStatic.Server(); ---> I also tried new nStatic.Server('filepath')
//setting middleware

http.createServer(function (req, res) { 
        fileServer.serve(req, res);
}).listen(9000);

我在命令提示符下使用节点 server.js 启动服务器。这是我看到的

http://localhost:9000:

节点-v 10.15.2 NPM -v 6.4.1

我不得不使用完整路径,直到文件夹才能看到它的内容,这现在看起来很明显,因为我 localhost:9000 从来都不是文件。

我用了这样的东西 - http://localhost:9000/Test/test.txt