Comments (5)
@fsiatama try the following steps:
Install http-proxy-middleware
npm install --save http-proxy-middleware
More Info at https://github.com/chimurai/http-proxy-middleware
Update src/server.js
for adding proxy middleware
import proxy from 'http-proxy-middleware';
import express from 'express';
// Create proxy instance
var apiProxy = proxy('http://localhost:8888/api/endpoint/');
// Create proxy middleware
var proxyMiddleware = express();
proxyMiddleware.use('/api', apiProxy);
// Add middleware to pawjs
export default class Server {
constructor({ addMiddleware }) {
addMiddleware(proxyMiddleware);
// ... Other code
}
apply(serverHandler) {
// ... Other code
}
}
from pawjs.
would be great for me too!
from pawjs.
We can add custom middleware via server.js as express proxy server. I can create a an example repo for it and can document it as well
from pawjs.
that would be great for SSR, thanks!.
Can you make a solution for SPA as well?
from pawjs.
Please, I also need this urgently, thank you very much.
from pawjs.
Related Issues (20)
- How to upgrade from pawjs v1 HOT 1
- Modifying config dynamically HOT 4
- How can we implement Reducer Injection Approaches for Redux? HOT 2
- Modifying page properties HOT 1
- Support for styled-components HOT 3
- Changing the location of the manifest.json file
- CSS loading order HOT 1
- window is not defined issue even serverSideRender is set to false HOT 1
- How to change port dynamically
- persisting redux middleware
- image-optimization page not found HOT 1
- Problem with LoadableComponent. Null reference.
- Struggling with Changing the Meta Titles HOT 1
- on browser back event route loadData is not triggering
- CSS Load Order different in Dev vs Prod HOT 4
- await inside of async apply(clientHandler) causes crashes on older Safari IOS
- Support for Recoil.js
- Suddenly getting "TypeError: Cannot read property 'indexOf' of null at sw.js" error in console in all production pawjs project HOT 2
- getSearchParams return closure for server side access.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pawjs.