Skip to content

excroll/react_vite_express_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Setup

  • Add the following to client/vite.config.js Here /api/v1 is mapped to http://localhost:5000/ which is where the server resides
    server: {
        proxy: {
          "/api/v1": "http://localhost:5000/",
        },
      },
    
    
  • The react app uses /api/v1 as base url and the server base endpoint url is /api/v1
  • Using /api/v1 as base url is arbitrary. Notice however that it appears in 3 places : client/vite.config.js , on the client side source files and on the server side source files

Installation

Perform the following from root directory , client directory and server directory
npm i

Run the project

Invoke from the root project to run the server and the client. This is done using concurrently
npm start

Limitation

i was not able to map "/" because then localhost:3000/ is used

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published