Skip to content

Commit c2845cc

Browse files
committed
polish(payments-api): Remove root accessor and default api path prefix
Because: * Payments API shares code and services with other applications in the fxa ecosystem, but came with a default /api/ base path prefix for all routes * This prefix causes some confusion for the service health checks, which expect all heartbeat and version endpoints to be off of the root path for all services This commit: * Removes the /api/ base prefix, as it is not required by internal or external stakeholders, and appears to be an inherited default value * removes the root ('/') endpoint, as its purpose is not yet defined Closes #N/A (relates to SVCSE-4181)
1 parent 28e1975 commit c2845cc

5 files changed

Lines changed: 2 additions & 28 deletions

File tree

apps/payments/api/src/app/app.controller.spec.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ describe('AppController', () => {
1212
}).compile();
1313
});
1414

15-
describe('getData', () => {
16-
it('should return "Hello world"', () => {
17-
const appController = app.get<AppController>(AppController);
18-
expect(appController.getData()).toEqual({ message: 'Hello world' });
19-
});
20-
});
21-
2215
describe('service status endpoints', () => {
2316
it('__heartbeat__ should return empty object', () => {
2417
const appController = app.get<AppController>(AppController);

apps/payments/api/src/app/app.controller.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ import { AppService } from './app.service';
55
export class AppController {
66
constructor(private readonly appService: AppService) {}
77

8-
@Get()
9-
getData() {
10-
return this.appService.getData();
11-
}
12-
138
@Get('__lbheartbeat__')
149
__lbheartbeat__() {
1510
return this.appService.__lbheartbeat__();

apps/payments/api/src/app/app.service.spec.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ describe('AppService', () => {
1212
service = app.get<AppService>(AppService);
1313
});
1414

15-
describe('getData', () => {
16-
it('should return "Hello API"', () => {
17-
expect(service.getData()).toEqual({ message: 'Hello API' });
18-
});
19-
});
20-
2115
describe('service status endpoints', () => {
2216
it('__heartbeat__ should return empty object', () => {
2317
expect(service.__heartbeat__()).toEqual({});

apps/payments/api/src/app/app.service.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ import { Injectable } from '@nestjs/common';
44
export class AppService {
55
constructor() {}
66

7-
getData() {
8-
return {
9-
message: 'Hello world',
10-
};
11-
}
12-
137
__heartbeat__() {
148
return {};
159
}

apps/payments/api/src/main.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ async function bootstrap() {
1111
const app = await NestFactory.create(AppModule, {
1212
rawBody: true,
1313
});
14-
const globalPrefix = 'api';
15-
app.setGlobalPrefix(globalPrefix);
16-
const port = process.env.PORT || 3000;
14+
const port = process.env.PORT || 3037;
1715
await app.listen(port);
1816
Logger.log(
19-
`🚀 Application is running on: http://localhost:${port}/${globalPrefix}`
17+
`🚀 Application is running on: http://localhost:${port}`
2018
);
2119
}
2220

0 commit comments

Comments
 (0)