feat: add devcontainer configuration and proxy setup for API requests#1473
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces devcontainer support and configures a proxy for frontend API requests. The changes enable development in a containerized environment and route API calls through a proxy to handle cross-origin requests.
- Adds proxy configuration to route
/api/**requests to an external API endpoint - Updates Angular development server configuration to use the proxy and bind to a specific host
- Introduces devcontainer configuration using a TypeScript/Node.js image for consistent development environments
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| frontend/src/proxy.conf.json | New proxy configuration file that routes API requests to the external rocketadmin.com endpoint |
| frontend/angular.json | Updates Angular dev server configuration to use the proxy and bind to 127.0.0.1 |
| .devcontainer/devcontainer.json | Adds devcontainer configuration with Node.js 22 TypeScript image for containerized development |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,6 @@ | |||
| { | |||
| "/api/**": { | |||
| "target": "https://app.rocketadmin.com/api/", | |||
There was a problem hiding this comment.
The proxy target URL appears to have a double path issue. The target is set to "https://app.rocketadmin.com/api/" but the context is "/api/**". This means requests to "/api/endpoint" will be proxied to "https://app.rocketadmin.com/api/api/endpoint" with a duplicated "/api" path segment. The target should likely be "https://app.rocketadmin.com" without the "/api/" suffix.
| "target": "https://app.rocketadmin.com/api/", | |
| "target": "https://app.rocketadmin.com", |
| { | ||
| "/api/**": { | ||
| "target": "https://app.rocketadmin.com/api/", | ||
| "secure": false |
There was a problem hiding this comment.
Setting "secure" to false disables SSL certificate verification, which can expose the application to man-in-the-middle attacks. Unless there's a specific reason for this (e.g., self-signed certificates in development), this should be set to true for security best practices, especially when connecting to a production API endpoint.
| "secure": false | |
| "secure": true |
| "options": { | ||
| "buildTarget": "dissendium-v0:build" | ||
| "buildTarget": "dissendium-v0:build", | ||
| "host": "127.0.0.1", |
There was a problem hiding this comment.
Binding the development server to "127.0.0.1" may prevent access from outside the container in a devcontainer environment. For devcontainer usage, consider using "0.0.0.0" as the host to allow connections from the host machine, or omit the host configuration to use Angular's default behavior.
| "host": "127.0.0.1", | |
| "host": "0.0.0.0", |
No description provided.