y-server-plugin-static
y-server-plugin-static is a y-server plugin to read/proxy static resource.
Install
npm install y-server-plugin-static
Usage
const path = require('path');
const yServer = require('y-server');
const staticPlugin = require('y-server-plugin-static');
yServer({
plugins: [
staticPlugin({
staticPaths: {
'/test': path.join(__dirname, 'test'),
'/lbf': 'https://qidian.gtimg.com/lbf/1.0.4',
},
}),
],
});
Notes
staticPaths
is the Object which will be read/proxy.