Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhdanh27600 committed May 11, 2024
1 parent 0f8f343 commit b641228
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/uat.cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,21 @@ jobs:
NEXT_PUBLIC_SHORT_DOMAIN=false
push: true
tags: ghcr.io/${{ github.repository }}:uat-latest
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Azure Login
uses: azure/login@v1
with:
creds: ${{ secrets.QUICKSHAREFULLUAT1010_AZURE_CREDENTIALS }}
# deploy:
# runs-on: ubuntu-latest
# needs: build
# steps:
# - name: Azure Login
# uses: azure/login@v1
# with:
# creds: ${{ secrets.QUICKSHAREFULLUAT1010_AZURE_CREDENTIALS }}

- name: Deploy to container image
uses: azure/container-apps-deploy-action@v1
with:
containerAppName: quickshare-full-uat-1010
resourceGroup: shared
imageToDeploy: ghcr.io/${{ github.repository }}:uat-latest
# - name: Deploy to container image
# uses: azure/container-apps-deploy-action@v1
# with:
# containerAppName: quickshare-full-uat-1010
# resourceGroup: shared
# imageToDeploy: ghcr.io/${{ github.repository }}:uat-latest
# deploy:
# needs: build
# runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions src/requests/api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from 'axios';
import { NextApiRequest, NextApiResponse } from 'next';
import { BASE_URL, alternativeUrls, brandUrl, brandUrlShort, localUrlShort } from '../types/constants';
import { BASE_URL, brandUrl, brandUrlShort, localUrlShort } from '../types/constants';

export const API = axios.create({
baseURL: BASE_URL,
Expand All @@ -26,7 +26,7 @@ export function withAuth(token?: string) {
};
}

const allowedOrigins = [brandUrl, localUrlShort, brandUrlShort, ...alternativeUrls];
const allowedOrigins = [brandUrl, localUrlShort, brandUrlShort];

export const allowCors = (handler: any) => async (req: NextApiRequest, res: NextApiResponse) => {
const origin = req.headers?.origin;
Expand Down
3 changes: 2 additions & 1 deletion src/services/queue/rabbit/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const amqp = require('amqplib');
const { logger } = require('../utils');
const { logger, isTest } = require('../utils');
const { postProcessForward } = require('../postProcessForward');


Expand All @@ -17,6 +17,7 @@ const queueName = process.env.RABBITMQ_QUEUE_NAME;
*/
async function sendMessageToRabbitQueue(message) {
try {
if (isTest) return;
if (!amqpUrl) throw new Error('Not found AMQP URL!')
if (!queueName) throw new Error('Queue name not found!')
// Connect to RabbitMQ
Expand Down
1 change: 0 additions & 1 deletion src/types/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const brandUrl = 'https://quickshare.at';
export const brandUrlShort = 'https://qsh.at';
export const brandUrlUat = 'https://uat.quickshare.at';
export const brandUrlShortUat = 'https://uat.qsh.at';
export const alternativeUrls = ['https://mirror.quickshare.at', 'https://mirror.qsh.at'];

export const brandUrlShortDomain = 'qsh.at';
export const isTest = process.env.NODE_ENV === 'test';
Expand Down

0 comments on commit b641228

Please sign in to comment.