https://github.com/royrusso/react_express
A sandbox on how to get Vite+React app to be served from a Node backend.
https://github.com/royrusso/react_express
Last synced: about 1 year ago
JSON representation
A sandbox on how to get Vite+React app to be served from a Node backend.
- Host: GitHub
- URL: https://github.com/royrusso/react_express
- Owner: royrusso
- License: apache-2.0
- Created: 2025-01-29T18:59:27.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-30T15:36:42.000Z (over 1 year ago)
- Last Synced: 2025-06-14T04:44:17.289Z (about 1 year ago)
- Language: CSS
- Size: 51.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Vite+React with Node backend
A sandbox on how to get Vite+React app to be served from a Node backend.
## Development Mode
Development mode let's you run the Vite+React app and the Node backend separately.
### Vite+React
```bash
cd frontend
npm install
npm run dev
```
UI will be served at [http://localhost:5173/](http://localhost:5173/) by default.
### Node backend
```bash
cd backend
npm install
npm run dev
```
Server will be served at [http://localhost:3000](http://localhost:3000) by default.
## Production Mode
Production mode let's you run the Vite+React app and the Node backend together.
### Add dependencies
```bash
cd frontend
npm install
```
```bash
cd backend
npm install
```
```bash
cd ..
npm install
```
### Run the app
```bash
npm run build
npm run dev
```
UI should be served from the backend at [http://localhost:3000](http://localhost:3000) by default.