v3 API prefix

This commit is contained in:
Paul Schneider 2026-07-05 20:17:12 +01:00
commit cd72b7b9aa
16 changed files with 24 additions and 32 deletions

View file

@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<apikeys>
</apikeys>
<packageSources>
<add key="dev" value="http://localhost:5000/index.json" protocolVersion="3" />
<!-- <add key="isn-prod" value="https://isn.pschneider.fr/index.json" protocolVersion="3" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> -->
</packageSources>
</configuration>

View file

@ -22,7 +22,7 @@ namespace Isn.tests
public LocalSourceFixture()
{
var port = GetFreePort();
var prefix = $"http://127.0.0.1:{port}/";
var prefix = $"http://127.0.0.1:{port}/"+Constants.APIPrefix;
listener = new HttpListener();
listener.Prefixes.Add(prefix);
listener.Start();

View file

@ -18,6 +18,7 @@ using NuGet.Configuration;
using System.Threading.Tasks;
using NuGet.Protocol.Core.Types;
using NuGet.Common;
using Isn.Abstract;
namespace isnd.host.tests
{
@ -72,7 +73,7 @@ namespace isnd.host.tests
using (var serviceScope = server.Host.Services.CreateScope())
{
var isnSettings = serviceScope.ServiceProvider.GetService<IOptions<isnd.Entities.IsndSettings>>().Value;
string pkgSourceUrl = isnSettings.ExternalUrl + "/pkgs/index.json";
string pkgSourceUrl = isnSettings.ExternalUrl + "/" + Constants.APIPrefix + "index.json";
using var client = new HttpClient();
var response = client.GetAsync(pkgSourceUrl).GetAwaiter().GetResult();
var body = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();