Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

firebase hosting rewrite function You need to enable JavaScript to run this app.

The issue could be due to the order of your firebase.json rewrites. If 
{
  "source": "**",
  "destination": "/index.html"
}
is at the top of your rewrites then everything will match the "**" wildcard first, which is not what we want.

Instead, put the api (or whatever) rewrites first and put "**" last. E.g:
"rewrites": [
  {
    "source": "/api/**",
    "function": "api"
  },
  {
    "source": "**",
    "destination": "/index.html"
  }
]
This way the "/api/**" route is caught first and then everything else falls through. (Obvious in hindsight...)

Hope this helps save someone else a few hours!
Comment

PREVIOUS NEXT
Code Example
Javascript :: hreroku 
Javascript :: jquery datatable searchpane pagination not working 
Javascript :: convert .js file to ts 
Javascript :: get window object in nextjs 
Javascript :: style mapbox paint data driven 
Javascript :: swift urlsession remote json 
Javascript :: html select structure 
Javascript :: Check if the same text is repeated javascript todo-app 
Javascript :: samesite cookies/console.log 
Javascript :: create useTransaction 
Javascript :: html video api set speed 
Javascript :: jquery keypress div color change 
Javascript :: how to convert numbers to roman numerals in javascript 
Javascript :: Plumsail add a button to the left side of the toolbar, which will be hidden until an item is selected 
Javascript :: convert csv to json typescript 
Javascript :: convert string to file angular 
Javascript :: laravel , json Why it shows Cannot access offset of type string on string error 
Javascript :: js remove child with index 
Javascript :: AngularJS ui-select multiple should show alert if limit is crossed 
Javascript :: tabbarbadge style react native 
Javascript :: Chrome DevTools - why does variable display in Watch but not under Scope 
Javascript :: Pass JSON array to function in React as props and then count items in area 
Javascript :: Add and remove required attribute based on whether it is visible or hidden 
Javascript :: how to set the x and y axis title in plotly express bar 
Javascript :: yaml request body json 
Javascript :: open div with onClick element position 
Javascript :: Importing Ky Module In JavaScript 
Javascript :: Bare Minimum Passport Login Pages App.js 
Javascript :: force browser reload page from server javascript 
Javascript :: auto load in element show 
ADD CONTENT
Topic
Content
Source link
Name
4+3 =