Skip to content

Commit

Permalink
EES-5663 Remove /api prefix from public API routes
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsim committed Nov 18, 2024
1 parent 6c0e642 commit 0c204af
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion infrastructure/templates/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -2114,7 +2114,7 @@
"NEXT_CONFIG_MODE": "server",
"NODE_ENV": "production",
"PUBLIC_URL": "[concat(variables('publicAppUrl'), '/')]",
"PUBLIC_API_BASE_URL": "[concat('https://', parameters('publicApiUrl'), '/api/v1')]",
"PUBLIC_API_BASE_URL": "[concat('https://', parameters('publicApiUrl'), '/v1')]",
"PUBLIC_API_DOCS_URL": "[concat('https://', parameters('publicApiDocsUrl'))]",
"WEBSITE_NODE_DEFAULT_VERSION": "20.16.0",
"WEBSITES_PORT": 3000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task<Either<ActionResult, HttpResponseMessage>> GetDataSetVersionCh
{
return await SendRequest(
() => httpClient.GetAsync(
$"api/v1/data-sets/{dataSetId}/versions/{dataSetVersion}/changes",
$"v1/data-sets/{dataSetId}/versions/{dataSetVersion}/changes",
cancellationToken
),
cancellationToken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Tests.Contr

public abstract class DataSetVersionsControllerTests(TestApplicationFactory testApp) : IntegrationTestFixture(testApp)
{
private const string BaseUrl = "api/v1/data-sets";
private const string BaseUrl = "v1/data-sets";

public class ListDataSetVersionsTests(TestApplicationFactory testApp) : DataSetVersionsControllerTests(testApp)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Tests.Contr

public abstract class DataSetsControllerGetQueryTests(TestApplicationFactory testApp) : IntegrationTestFixture(testApp)
{
private const string BaseUrl = "api/v1/data-sets";
private const string BaseUrl = "v1/data-sets";

private readonly TestDataSetVersionPathResolver _dataSetVersionPathResolver = new()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Tests.Contr

public abstract class DataSetsControllerPostQueryTests(TestApplicationFactory testApp) : IntegrationTestFixture(testApp)
{
private const string BaseUrl = "api/v1/data-sets";
private const string BaseUrl = "v1/data-sets";

private readonly TestDataSetVersionPathResolver _dataSetVersionPathResolver = new()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Tests.Contr

public abstract class DataSetsControllerTests(TestApplicationFactory testApp) : IntegrationTestFixture(testApp)
{
private const string BaseUrl = "api/v1/data-sets";
private const string BaseUrl = "v1/data-sets";

public class GetDataSetTests(TestApplicationFactory testApp) : DataSetsControllerTests(testApp)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Tests.Contr

public abstract class PublicationsControllerTests(TestApplicationFactory testApp) : IntegrationTestFixture(testApp)
{
private const string BaseUrl = "api/v1/publications";
private const string BaseUrl = "v1/publications";

public class ListPublicationsTests(TestApplicationFactory testApp) : PublicationsControllerTests(testApp)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Controllers

[ApiVersion("1")]
[ApiController]
[Route("api/v{version:apiVersion}/data-sets/{dataSetId:guid}/versions")]
[Route("v{version:apiVersion}/data-sets/{dataSetId:guid}/versions")]
public class DataSetVersionsController(
IDataSetService dataSetService,
IDataSetVersionChangeService dataSetVersionChangeService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Controllers

[ApiVersion("1")]
[ApiController]
[Route("api/v{version:apiVersion}/data-sets")]
[Route("v{version:apiVersion}/data-sets")]
public class DataSetsController(
IDataSetService dataSetService,
IDataSetQueryService dataSetQueryService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace GovUk.Education.ExploreEducationStatistics.Public.Data.Api.Controllers

[ApiVersion("1")]
[ApiController]
[Route("api/v{version:apiVersion}/publications")]
[Route("v{version:apiVersion}/publications")]
public class PublicationsController(IPublicationService publicationService, IDataSetService dataSetService)
: ControllerBase
{
Expand Down
2 changes: 1 addition & 1 deletion src/explore-education-statistics-frontend/.env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CONTENT_API_BASE_URL=http://localhost:5010/api
DATA_API_BASE_URL=http://localhost:5000/api
PUBLIC_API_BASE_URL=http://localhost:5050/api/v1
PUBLIC_API_BASE_URL=http://localhost:5050/v1
PUBLIC_API_DOCS_URL=https://dev.statistics.api.education.gov.uk/docs
NOTIFICATION_API_BASE_URL=http://localhost:7073/api
GA_TRACKING_ID=
Expand Down

0 comments on commit 0c204af

Please sign in to comment.