Skip to content

Commit 560b4c3

Browse files
committed
fix: update API URL paths in various strategies and configuration files to remove '/api' prefix
1 parent d5a93b3 commit 560b4c3

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ On the frontend, you can set the environment variables in a `.env.local` file or
104104
THUMBNAIL_URL=localhost:9000
105105
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=
106106
NEXT_PUBLIC_URL=http://localhost:3000
107-
NEXT_PUBLIC_API_URL=http://localhost:4000/api/v1
107+
NEXT_PUBLIC_API_URL=http://localhost:4000/v1
108108
```
109109

110110
---
@@ -152,7 +152,7 @@ You can populate the development database with test data using:
152152

153153
```bash
154154
curl -X 'GET' \
155-
'http://localhost:4000/api/v1/seed/seed-dev' \
155+
'http://localhost:4000/v1/seed/seed-dev' \
156156
-H 'accept: */*'
157157
```
158158

apps/backend/src/auth/strategies/discord.strategy/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class DiscordStrategy extends PassportStrategy(strategy, 'discord') {
2424
const config = {
2525
clientID: DISCORD_CLIENT_ID,
2626
clientSecret: DISCORD_CLIENT_SECRET,
27-
callbackUrl: `${SERVER_URL}/api/v1/auth/discord/callback`,
27+
callbackUrl: `${SERVER_URL}/v1/auth/discord/callback`,
2828
scope: [DiscordPermissionScope.Email, DiscordPermissionScope.Identify],
2929
fetchScope: true,
3030
prompt: 'none',

apps/backend/src/auth/strategies/github.strategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class GithubStrategy extends PassportStrategy(strategy, 'github') {
2222
super({
2323
clientID: GITHUB_CLIENT_ID,
2424
clientSecret: GITHUB_CLIENT_SECRET,
25-
redirect_uri: `${SERVER_URL}/api/v1/auth/github/callback`,
25+
redirect_uri: `${SERVER_URL}/v1/auth/github/callback`,
2626
scope: 'user:read,user:email',
2727
state: false,
2828
});

apps/backend/src/auth/strategies/google.strategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') {
1919

2020
const SERVER_URL = configService.getOrThrow<string>('SERVER_URL');
2121

22-
const callbackURL = `${SERVER_URL}/api/v1/auth/google/callback`;
22+
const callbackURL = `${SERVER_URL}/v1/auth/google/callback`;
2323
GoogleStrategy.logger.debug(`Google Login callbackURL ${callbackURL}`);
2424

2525
super({

apps/backend/src/auth/strategies/magicLinkEmail.strategy.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('MagicLinkEmailStrategy', () => {
6262
const email = '[email protected]';
6363

6464
const magicLink =
65-
'http://localhost/api/v1/auth/magic-link/callback?token=test_token';
65+
'http://localhost/v1/auth/magic-link/callback?token=test_token';
6666

6767
const user = { username: 'testuser', email };
6868

@@ -80,7 +80,7 @@ describe('MagicLinkEmailStrategy', () => {
8080
to: email,
8181
context: {
8282
magicLink:
83-
'http://localhost/api/v1/auth/magic-link/callback?token=test_token',
83+
'http://localhost/v1/auth/magic-link/callback?token=test_token',
8484
username: 'testuser',
8585
},
8686
subject: 'Noteblock Magic Link',
@@ -92,7 +92,7 @@ describe('MagicLinkEmailStrategy', () => {
9292
const email = '[email protected]';
9393

9494
const magicLink =
95-
'http://localhost/api/v1/auth/magic-link/callback?token=test_token';
95+
'http://localhost/v1/auth/magic-link/callback?token=test_token';
9696

9797
const user = { username: 'testuser', email };
9898

@@ -111,7 +111,7 @@ describe('MagicLinkEmailStrategy', () => {
111111
to: email,
112112
context: {
113113
magicLink:
114-
'http://localhost/api/v1/auth/magic-link/callback?token=test_token',
114+
'http://localhost/v1/auth/magic-link/callback?token=test_token',
115115
username: 'testuser',
116116
},
117117
subject: 'Welcome to Noteblock.world',

apps/backend/src/auth/strategies/magicLinkEmail.strategy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export class MagicLinkEmailStrategy extends PassportStrategy(
3030
) {
3131
super({
3232
secret: MAGIC_LINK_SECRET,
33-
confirmUrl: `${SERVER_URL}/api/v1/auth/magic-link/confirm`,
34-
callbackUrl: `${SERVER_URL}/api/v1/auth/magic-link/callback`,
33+
confirmUrl: `${SERVER_URL}/v1/auth/magic-link/confirm`,
34+
callbackUrl: `${SERVER_URL}/v1/auth/magic-link/callback`,
3535
sendMagicLink: MagicLinkEmailStrategy.sendMagicLink(
3636
SERVER_URL,
3737
userService,

apps/backend/src/song/song-upload/song-upload.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class SongUploadService {
4949

5050
if (!this.soundsMapping) {
5151
const response = await fetch(
52-
process.env.SERVER_URL + '/api/v1/data/soundList.json',
52+
process.env.SERVER_URL + '/v1/data/soundList.json',
5353
);
5454

5555
this.soundsMapping = (await response.json()) as Record<string, string>;
@@ -64,7 +64,7 @@ export class SongUploadService {
6464
if (!this.soundsSubset) {
6565
try {
6666
const response = await fetch(
67-
process.env.SERVER_URL + '/api/v1/data/soundList.json',
67+
process.env.SERVER_URL + '/v1/data/soundList.json',
6868
);
6969

7070
const soundMapping = (await response.json()) as Record<string, string>;

apps/frontend/.env.local.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
THUMBNAIL_URL=
22
NEXT_PUBLIC_RECAPTCHA_SITE_KEY=
33
NEXT_PUBLIC_URL=http://localhost:3000
4-
NEXT_PUBLIC_API_URL=http://localhost:4000/api/v1
4+
NEXT_PUBLIC_API_URL=http://localhost:4000/v1
55
NEXT_PUBLIC_APP_DOMAIN=

0 commit comments

Comments
 (0)