How to use sp-rest-proxy - 2 common examples

To help you get started, we’ve selected a few sp-rest-proxy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github koltyakov / sp-build-tasks / src / webpack / devServer.ts View on Github external
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);
      });
    }
  };
github koltyakov / sp-build-tasks / src / webpack / config.ts View on Github external
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);
    });
  }
};

sp-rest-proxy

SharePoint REST API Proxy for Node.js and Express local serve

MIT
Latest version published 9 months ago

Package Health Score

53 / 100
Full package analysis

Popular sp-rest-proxy functions