Giter Club home page Giter Club logo

Comments (7)

maxparelius avatar maxparelius commented on May 18, 2024 1

@vinzun @Butonix proxy is much different behavior with ssr so it does not work the same as in cra. I am not sure why you need a proxy. Any request from the browser goes to the rendering server by default. If you want it to go somewhere else just use the full url. If you really want a proxy you can implement it at the node level in the rendering server.

from create-react-ssr-app.

Butonix avatar Butonix commented on May 18, 2024

Adding proxy in package.json is not working but if I add it directly in axios.get() it is working.
This is what I get when it is from the proxy in package.json
image

And when I npm start I'm getting this DeprecationWarning
image

Already tried proxy in package.json in create-react-app and it is working.
image

I, too, wrote about this author, but he ignored me! There is no support, so it is better not to use this repository!

from create-react-ssr-app.

vincezun avatar vincezun commented on May 18, 2024

Maybe they are busy, so we wait...

from create-react-ssr-app.

Butonix avatar Butonix commented on May 18, 2024

Maybe they are busy, so we wait...

No, he just silently closed my question.
Try razzle he's a lot better

from create-react-ssr-app.

vincezun avatar vincezun commented on May 18, 2024

Thanks for the info. I am new to this, learning new stuffs. I also tried it with different framework and noticed that it's not working with any ssr. I'm trying to research about this and spent a lot of time. Thanks again bro!

from create-react-ssr-app.

maxparelius avatar maxparelius commented on May 18, 2024

@vinzun what does your stack look like? Generally a proxy is useful when you want some route (e.g. /my_profile) to go somewhere else other than the server that served the app. With CRA its useful since the app is served by a webpack dev server and api requests are not handled by that server. So a proxy allows to send api requests to the api server. In my stack I generally use a single node server just for rendering. Create React SSR App comes with this server configured. I then use a different server (rails, node, go, or something else) to handle API requests. In my client code I use the full url for API requests (e.g. http://localhost:3000/my_profile rather than /my_profile) so which makes proxy unecessary.

from create-react-ssr-app.

vincezun avatar vincezun commented on May 18, 2024

Im creating a website using React and WP Rest Api, it just got me thinking about how headless cms will be called when it comes to production.

from create-react-ssr-app.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.