Skip to content

Add .http file to ApiService in starter template #9973

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025

Conversation

DamianEdwards
Copy link
Member

Description

Adds a .http file to the ApiService project in the starter template.

Fixes #9592

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • No
  • Did you add public API?
    • No
  • Does the change make any security assumptions or guarantees?
    • No
  • Does the change require an update in our Aspire docs?
    • No

@Copilot Copilot AI review requested due to automatic review settings June 20, 2025 22:04
@DamianEdwards DamianEdwards requested a review from radical June 20, 2025 22:04
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new HTTP request template for the ApiService project in the starter template, enabling quick manual testing of the default weather forecast endpoint.

  • Introduces a .http file with a configurable host address and a GET request for /weatherforecast.
  • Provides a template variable for the service host that can be adjusted locally.
Comments suppressed due to low confidence (1)

src/Aspire.ProjectTemplates/templates/aspire-starter/9.4/Aspire-StarterApplication.1.ApiService/Aspire-StarterApplication.1.ApiService.http:1

  • [nitpick] Consider adding a brief comment at the top of this .http file explaining its purpose and how to run it (e.g., using the VS Code REST Client extension) so that users unfamiliar with .http files can quickly get started.
@Aspire_StarterApplication.1.ApiService_HostAddress = http://localhost:5301

@@ -0,0 +1,6 @@
@ApiService_HostAddress = http://localhost:5301
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Must be missing something, but shouldn't this be the https one? So port 7301?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this matches what the API template does, and it's because if the app is launched with the "http" launch profile, there won't be an HTTPS port, only HTTP. The HTTP port is consistent between both the "http" and "https" launch profiles so we use it here.

Copy link
Member

@joperezr joperezr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comment but looks good otherwise.

@DamianEdwards DamianEdwards merged commit 0c37bc7 into main Jun 20, 2025
252 checks passed
@DamianEdwards DamianEdwards deleted the damianedwards/tempate-http-file branch June 20, 2025 22:45
captainsafia pushed a commit that referenced this pull request Jun 20, 2025
* Add .http file to ApiService in starter template

Fixes #9592

* Simplify variable name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When creating the ApiService project we should add an HTTP file
2 participants