Skip to content

This server is designed to handle sites built with React Router's BrowserRouter

Notifications You must be signed in to change notification settings

bennebbenneb/react-js-push-state-server-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Go Server for React Projects Using Push State

This server is designed to handle sites built with BrowserRouter.

Instructions

  1. Build your React project react-scripts build and copy it to /web/
  2. Test on localhost
    1. Run dev_appserver.py app.yaml in the same directory as the app.yaml file
    2. Open browser and navigate to http://localhost:8080
  3. Deploy to Google App Engine
    1. Run gcloud app deploy in the same directory as the app.yaml file

Adding more static directories

During your react build, any folder in /public/ will create it's own static directory. These folders need to be added to the staticPaths array.

  1. Open main.go in a text editor
  2. Add elements to the staticPaths string array

Example

staticPaths := [...]string{"/static/", "/img/", "/media/"}

About

This server is designed to handle sites built with React Router's BrowserRouter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages