Skip to content

Janaka-Steph/react-spa-openfaas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React.js SPA on OpenFaaS With Dockferfile Template in Static mode

Minimal React.js Single Page Application packaged for OpenFaaS with the dockerfile template and the watchdog in static mode. The client-side routing is done with React-Router.

The issue is that any page other than the homepage will return a 404 error when requested from the server (when refreshing the page).

A Single Page Application technically only have a single index.html, and should redirect every possible url pointed to the domain at this index.html located at the root.

This is usually done with a catch-all rule on an Express server or Nginx reverse proxy.

Note that the website is served at https://DOMAIN_NAME/function/react-spa by adding PUBLIC_URL=/function/react-spa in .env and setting the basename property passed to the Router component.

Step to Reproduce

Run OpenFaaS locally

$ kubectl port-forward svc/gateway -n openfaas 8080:8080
$ faas-cli up

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published