You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simplify deployment to single Express service (ATXP-258) (#15)
* Simplify deployment architecture to single Express service
- **Single-service architecture**: Express server now serves both API endpoints and React frontend
- **Simplified deployment**: Eliminates inter-service hostname issues across all platforms
- **Enhanced static file serving**: Robust path resolution with fallback handling
- **Updated documentation**: README reflects single-service production architecture
- **Optimized configurations**: Vercel and Render configs now use single service deployment
- **Streamlined npm scripts**: `npm start` builds and runs single production server
Closes ATXP-258
-**Production Ready**: Single-service deployment with built-in static file serving
37
+
-**CORS Enabled**: Cross-origin requests supported for development
38
38
-**Error Handling**: Comprehensive error handling and user feedback
39
39
40
40
## API Endpoints
@@ -90,14 +90,15 @@ After deploying, you'll need to provide your ATXP connection string through the
90
90
91
91
### Production Mode
92
92
93
-
To run in production mode (with optimized builds and single browser opening):
93
+
To run in production mode (single server serving both API and frontend):
94
94
```bash
95
-
npm run start
95
+
npm run build
96
+
npm start
96
97
```
97
98
98
-
This runs the built backend and frontend in production mode without React StrictMode's double-mounting behavior.
99
+
This builds both components and starts the Express server in production mode, serving both the API endpoints and the React frontend from a single service.
99
100
100
-
### Running Separately
101
+
### Running Separately (Development Only)
101
102
102
103
-**Backend only**: `npm run server`
103
104
-**Frontend only**: `npm run client`
@@ -114,6 +115,12 @@ This runs the built backend and frontend in production mode without React Strict
114
115
npm start
115
116
```
116
117
118
+
The server will start on the configured port (default: 3001) and serve both:
119
+
- API endpoints at `/api/*`
120
+
- React frontend at all other routes
121
+
122
+
**Note**: Always run `npm run build` before `npm start` to ensure you have the latest production builds.
123
+
117
124
## Environment Variables
118
125
119
126
### Backend Configuration
@@ -124,7 +131,7 @@ Create a `.env` file in the `backend/` directory:
124
131
# Server port configuration
125
132
PORT=3001
126
133
127
-
# Frontend port (for CORS configuration)
134
+
# Frontend port (for CORS configuration in development)
0 commit comments