Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
before: (app) => { // (app, server) => {
// Register SP API Proxy
const settings: IProxySettings = {
port: devServerPort,
authConfigSettings: {
authOptions: { ...privateConf, ...privateConf.creds },
saveConfigOnDisk: false
},
strictRelativeUrls: true
};
new RestProxy(settings, app).serveProxy();
// Register static assets under the publish path route
app.get(`${publishPath}/*`, (req: any, res: any, _next: any) => {
const filePath = path.join(
process.cwd(),
appConf.distFolder,
req.url.replace(publishPath, '').split('?')[0]
);
res.sendFile(filePath);
});
}
};
before: (app, _server) => {
// Register SP API Proxy
const settings: IProxySettings = {
port: devServerPort,
authConfigSettings: {
authOptions: { ...privateConf, ...privateConf.creds },
saveConfigOnDisk: false
},
strictRelativeUrls: true
};
new RestProxy(settings, app).serveProxy();
// Register static assets under the publish path route
app.get(`${publishPath}/*`, (req: any, res: any, _next: any) => {
const filePath = path.join(
process.cwd(),
appConf.distFolder,
req.url.replace(publishPath, '').split('?')[0]
);
res.sendFile(filePath);
});
}
};