A new Server Info component has been added to the application header that displays clickable server endpoints.
[GitHub Icon] [Title] [Server Info] [Repo Input]
📡 Server: [http://localhost:4000] 🔌 Port: [4000]
-
Blue Button (Server): Shows the public server URL
- Click to open
http://localhost:4000in a new tab - Useful for accessing API endpoints directly
- Click to open
-
Green Button (Port): Shows the port number
- Click to open
http://localhost:4000in a new tab - Quick access to the server
- Click to open
✅ Automatic on App Start
- Server info is fetched and displayed immediately when the app loads
✅ Clickable Endpoints
- Both the server URL and port number are clickable buttons
- Click opens the endpoint in a new browser tab
- Useful for testing API endpoints, checking server status, etc.
✅ Loading State
- Shows "🔄 Loading..." while fetching server config
- Shows "
⚠️ Server info unavailable" if there's an error
✅ Responsive Styling
- Styled with hover effects (darker colors on hover)
- Uses Tailwind CSS for consistent theming
- Monospace font for the endpoint URLs
Returns server configuration as JSON:
{
"port": 4000,
"publicUrl": "http://localhost:4000",
"timestamp": "2025-10-29T12:34:56.789Z"
}This endpoint is called once when the app mounts to populate the ServerInfo component.
-
server/index.ts
- Added
/api/configendpoint that returns port and URL info
- Added
-
services/api.ts
- Added
getServerConfig()function to fetch server configuration
- Added
-
App.tsx
- Imported ServerInfo component
- Added ServerInfo to header JSX
-
components/ServerInfo.tsx (NEW)
- React component that fetches and displays server info
- Handles loading and error states
- Provides clickable buttons to open endpoints
When the app loads, you'll see in the header:
┌──────────────────────────────────────────────────────────────┐
│ [GitHub Icon] │
│ GitHub Commit Workspace Runner 📡 Server: [localhost:4000] │
│ 🔌 Port: [4000] │
│ [Search Repo Input] │
└──────────────────────────────────────────────────────────────┘
- Hover over buttons to see color change and tooltip
- Click either button to open the server endpoint in a new tab
- Quick API Testing: Click the server URL to test endpoints in browser
- Port Reference: Always know which port the server is running on
- Multi-Server Setup: If you have multiple servers, this helps identify which one you're connected to
- Troubleshooting: If buttons are greyed out, the server might not be responding to /api/config
- When the React app mounts,
ServerInfocomponent is rendered useEffecthook triggersgetServerConfig()API call- Backend responds with port and public URL
- Component displays two clickable buttons
- Clicking either button opens the endpoint in a new tab