diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 767ae572..392f420f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -104,7 +104,7 @@ On the frontend, you can set the environment variables in a `.env.local` file or THUMBNAIL_URL=localhost:9000 NEXT_PUBLIC_RECAPTCHA_SITE_KEY= NEXT_PUBLIC_URL=http://localhost:3000 -NEXT_PUBLIC_API_URL=http://localhost:4000/api/v1 +NEXT_PUBLIC_API_URL=http://localhost:4000/v1 ``` --- @@ -152,7 +152,7 @@ You can populate the development database with test data using: ```bash curl -X 'GET' \ - 'http://localhost:4000/api/v1/seed/seed-dev' \ + 'http://localhost:4000/v1/seed/seed-dev' \ -H 'accept: */*' ``` diff --git a/apps/backend/src/auth/strategies/discord.strategy/index.ts b/apps/backend/src/auth/strategies/discord.strategy/index.ts index 61dc578a..c31ea7e0 100644 --- a/apps/backend/src/auth/strategies/discord.strategy/index.ts +++ b/apps/backend/src/auth/strategies/discord.strategy/index.ts @@ -24,7 +24,7 @@ export class DiscordStrategy extends PassportStrategy(strategy, 'discord') { const config = { clientID: DISCORD_CLIENT_ID, clientSecret: DISCORD_CLIENT_SECRET, - callbackUrl: `${SERVER_URL}/api/v1/auth/discord/callback`, + callbackUrl: `${SERVER_URL}/v1/auth/discord/callback`, scope: [DiscordPermissionScope.Email, DiscordPermissionScope.Identify], fetchScope: true, prompt: 'none', diff --git a/apps/backend/src/auth/strategies/github.strategy.ts b/apps/backend/src/auth/strategies/github.strategy.ts index 27293151..b7ea82ab 100644 --- a/apps/backend/src/auth/strategies/github.strategy.ts +++ b/apps/backend/src/auth/strategies/github.strategy.ts @@ -22,7 +22,7 @@ export class GithubStrategy extends PassportStrategy(strategy, 'github') { super({ clientID: GITHUB_CLIENT_ID, clientSecret: GITHUB_CLIENT_SECRET, - redirect_uri: `${SERVER_URL}/api/v1/auth/github/callback`, + redirect_uri: `${SERVER_URL}/v1/auth/github/callback`, scope: 'user:read,user:email', state: false, }); diff --git a/apps/backend/src/auth/strategies/google.strategy.ts b/apps/backend/src/auth/strategies/google.strategy.ts index a19e1789..4a045f57 100644 --- a/apps/backend/src/auth/strategies/google.strategy.ts +++ b/apps/backend/src/auth/strategies/google.strategy.ts @@ -19,7 +19,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') { const SERVER_URL = configService.getOrThrow('SERVER_URL'); - const callbackURL = `${SERVER_URL}/api/v1/auth/google/callback`; + const callbackURL = `${SERVER_URL}/v1/auth/google/callback`; GoogleStrategy.logger.debug(`Google Login callbackURL ${callbackURL}`); super({ diff --git a/apps/backend/src/auth/strategies/magicLinkEmail.strategy.spec.ts b/apps/backend/src/auth/strategies/magicLinkEmail.strategy.spec.ts index a77f26c6..54e4f877 100644 --- a/apps/backend/src/auth/strategies/magicLinkEmail.strategy.spec.ts +++ b/apps/backend/src/auth/strategies/magicLinkEmail.strategy.spec.ts @@ -62,7 +62,7 @@ describe('MagicLinkEmailStrategy', () => { const email = 'test@example.com'; const magicLink = - 'http://localhost/api/v1/auth/magic-link/callback?token=test_token'; + 'http://localhost/v1/auth/magic-link/callback?token=test_token'; const user = { username: 'testuser', email }; @@ -80,7 +80,7 @@ describe('MagicLinkEmailStrategy', () => { to: email, context: { magicLink: - 'http://localhost/api/v1/auth/magic-link/callback?token=test_token', + 'http://localhost/v1/auth/magic-link/callback?token=test_token', username: 'testuser', }, subject: 'Noteblock Magic Link', @@ -92,7 +92,7 @@ describe('MagicLinkEmailStrategy', () => { const email = 'testuser@test.com'; const magicLink = - 'http://localhost/api/v1/auth/magic-link/callback?token=test_token'; + 'http://localhost/v1/auth/magic-link/callback?token=test_token'; const user = { username: 'testuser', email }; @@ -111,7 +111,7 @@ describe('MagicLinkEmailStrategy', () => { to: email, context: { magicLink: - 'http://localhost/api/v1/auth/magic-link/callback?token=test_token', + 'http://localhost/v1/auth/magic-link/callback?token=test_token', username: 'testuser', }, subject: 'Welcome to Noteblock.world', diff --git a/apps/backend/src/auth/strategies/magicLinkEmail.strategy.ts b/apps/backend/src/auth/strategies/magicLinkEmail.strategy.ts index eb528158..08ee579a 100644 --- a/apps/backend/src/auth/strategies/magicLinkEmail.strategy.ts +++ b/apps/backend/src/auth/strategies/magicLinkEmail.strategy.ts @@ -30,8 +30,8 @@ export class MagicLinkEmailStrategy extends PassportStrategy( ) { super({ secret: MAGIC_LINK_SECRET, - confirmUrl: `${SERVER_URL}/api/v1/auth/magic-link/confirm`, - callbackUrl: `${SERVER_URL}/api/v1/auth/magic-link/callback`, + confirmUrl: `${SERVER_URL}/v1/auth/magic-link/confirm`, + callbackUrl: `${SERVER_URL}/v1/auth/magic-link/callback`, sendMagicLink: MagicLinkEmailStrategy.sendMagicLink( SERVER_URL, userService, diff --git a/apps/backend/src/song/song-upload/song-upload.service.ts b/apps/backend/src/song/song-upload/song-upload.service.ts index bbf37b9d..400d8739 100644 --- a/apps/backend/src/song/song-upload/song-upload.service.ts +++ b/apps/backend/src/song/song-upload/song-upload.service.ts @@ -49,7 +49,7 @@ export class SongUploadService { if (!this.soundsMapping) { const response = await fetch( - process.env.SERVER_URL + '/api/v1/data/soundList.json', + process.env.SERVER_URL + '/v1/data/soundList.json', ); this.soundsMapping = (await response.json()) as Record; @@ -64,7 +64,7 @@ export class SongUploadService { if (!this.soundsSubset) { try { const response = await fetch( - process.env.SERVER_URL + '/api/v1/data/soundList.json', + process.env.SERVER_URL + '/v1/data/soundList.json', ); const soundMapping = (await response.json()) as Record; diff --git a/apps/frontend/.env.local.example b/apps/frontend/.env.local.example index 0ca9ef49..0695f03e 100644 --- a/apps/frontend/.env.local.example +++ b/apps/frontend/.env.local.example @@ -1,5 +1,5 @@ THUMBNAIL_URL= NEXT_PUBLIC_RECAPTCHA_SITE_KEY= NEXT_PUBLIC_URL=http://localhost:3000 -NEXT_PUBLIC_API_URL=http://localhost:4000/api/v1 +NEXT_PUBLIC_API_URL=http://localhost:4000/v1 NEXT_PUBLIC_APP_DOMAIN=