userjmillohara
userjmillohara

Reputation: 467

Combining static blog & react web-app on single domain? (gatsbyjs / reactjs)

Imagine the following scenario:

  1. I have a static website / blog, built with gatsbyjs.
  2. I also have a react webapp, which is not static, and to which users can sign into and do some other stuff.

I would like the user to be able to go to e.g. wwww.mywebapp.com and then either log into my non-static react web-app, OR click on blog and read my (static) gatsbyjs blog.

Is there a way for me to do this / combine the two? Or might I be better off using serverside rendering?

Upvotes: 2

Views: 632

Answers (2)

Harsh Raj
Harsh Raj

Reputation: 1

We can do that by modifying public(build) folder , package.json and gatsby.config....

Tutorial :- https://www.youtube.com/watch?v=5rUNlYs6wu4

Code :- https://github.com/benawad/gatsby-cra-combo

Hope this will also help !!!

Upvotes: 0

chmac
chmac

Reputation: 12625

You can build dynamic apps inside Gatsby. The approach is described in the docs here. But the general approach is:

  • Use Gatsby as normal
  • Add some client only routes

The client only routes will not be server rendered. More info in the docs.

Upvotes: 1

Related Questions