Home > Back-end >  Subdirectory as "/blogs" on firebase?
Subdirectory as "/blogs" on firebase?

Time:09-18

Is it possible to add a NextJs app as a subdirectory to a ReactJs app on firebase hosting? I have the main app already deployed to firebase with a domain and I want to add a NextJs app to its subdirectory "/blogs" for SEO purposes. Is this possible? If yes how? I have tried rewrites but did not get any success.

CodePudding user response:

Actually the config seems to be fine. You can only add a /** for taking all requests.

{ 
"hosting": {
"target": "main",
"public": "build",
"ignore": [
  "firebase.json",
  "**/.*",
  "**/node_modules/**"
],
"rewrites": [
  {
    "source": "/blogs/**",
    "destination": "/nextApp/index.html"
  }
]
}

If this is a nextjs app i would suggest to check that you set the base path correctly -> documentation

CodePudding user response:

If you would like to use multiple different frameworks in one project you might want to consider using Astro.

This video by Fireship explains Astro really well.

  • Related