-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript import #155
Comments
sp-rest-proxy is a Node.js library. So you won't import it in a React/Frontend sources as such code can't be bundled for a browser. Proxy is a "side car" process which runs as Node server next to local dev server. Usually, a client side project's TypeScript settings are different from a server side TypeScript project and it could be not a straight forward to configure both within the same code base. At the same time, it's a little scaffolding code you need for a proxy If your dev tools expose WebPack - this approach can be handy. Hope this helps. |
React app, using typescript.
version 3.2.2 of the sp-rest-proxy
I am not understanding your intructions for typescript.
You include the following in the docs:
import RestProxy, { IProxySettings } from 'sp-rest-proxy/dist/RestProxy';
const settings: IProxySettings = {
configPath: './config/private.json'
};
const restProxy = new RestProxy(settings);
restProxy.serve();
But I dont know where this is supposed to go, serve.js? Any guidance appreciated .
The text was updated successfully, but these errors were encountered: