有空可以看一下思路:
1.用 express框架 在启动的xxx.js设置静态资源路径
2.直接启动xxx.js
3.访问方法:
http://127.0.0.1:8093/static/image/123.jpg
http://127.0.0.1:8093/static/image/123.js
//express
var express = require('express');
var app = express();
//域名访问路径,静态资源位置(也可以大范围指定express.static('static'))
//静态资源目录D:\IdeaProjects\project\static\image\123.jpg
app.use('/static/image',express.static('./static/image'));