From 7d1053d7daf8fa5333bbb3d891240cf7dbdabd01 Mon Sep 17 00:00:00 2001 From: Abel Ratanaphan Date: Thu, 22 Aug 2024 18:34:32 -0400 Subject: [PATCH] feat: add prod and dev uri/url, minor updates to README --- .github/workflows/aws.yml | 2 ++ README.md | 2 +- client/src/features/auth/authAPI.ts | 7 ++++++- client/src/features/auth/components/LoginButton.tsx | 6 +++++- server/src/server.ts | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/aws.yml b/.github/workflows/aws.yml index 29f0e39..3f16c0d 100644 --- a/.github/workflows/aws.yml +++ b/.github/workflows/aws.yml @@ -53,7 +53,9 @@ jobs: # Use Docker Buildx to build the image for x86_64 docker buildx build --platform linux/amd64 --push -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + echo "image=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" >> $GITHUB_OUTPUT + echo "Docker image $ECR_REPOSITORY:$IMAGE_TAG has been built and pushed to $ECR_REGISTRY." - name: Deploy to Amazon ECS run: | diff --git a/README.md b/README.md index 3981e24..4d479ad 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Visualizer Dashboard for AWS EC2 Instances
Report Bug - ยท + | Request Feature

diff --git a/client/src/features/auth/authAPI.ts b/client/src/features/auth/authAPI.ts index 5625108..3984843 100644 --- a/client/src/features/auth/authAPI.ts +++ b/client/src/features/auth/authAPI.ts @@ -5,7 +5,12 @@ import { EC2Instance, EC2Stats } from '../../app/types'; export const authApi = createApi({ reducerPath: 'authApi', baseQuery: fetchBaseQuery({ - baseUrl: 'https://skyscraper-api.com/api/', + // Production baseURL + // baseUrl: 'https://skyscraper-api.com/api/', + + // Development baseURL + baseUrl: 'http://localhost:8080/api/', + prepareHeaders: (headers, { getState }) => { const state = getState() as RootState; const { access_token, id_token } = state.rootReducer.auth.tokens; diff --git a/client/src/features/auth/components/LoginButton.tsx b/client/src/features/auth/components/LoginButton.tsx index 4ff3971..afd9482 100644 --- a/client/src/features/auth/components/LoginButton.tsx +++ b/client/src/features/auth/components/LoginButton.tsx @@ -3,7 +3,11 @@ import React from 'react'; const LoginButton: React.FC = () => { const navigate = () => { window.location.href = - 'https://skyscraperwerock.auth.us-east-2.amazoncognito.com/oauth2/authorize?client_id=6hjtfh1ddmn4afj4c29ddijj32&response_type=token&scope=email+openid+phone+profile&redirect_uri=https%3A%2F%2Fskyscraper-api.com%2Fdashboard'; + // Production URI + // 'https://skyscraperwerock.auth.us-east-2.amazoncognito.com/oauth2/authorize?client_id=6hjtfh1ddmn4afj4c29ddijj32&response_type=token&scope=email+openid+phone+profile&redirect_uri=https%3A%2F%2Fskyscraper-api.com%2Fdashboard'; + + // Development URI + 'https://skyscraperwerock.auth.us-east-2.amazoncognito.com/oauth2/authorize?client_id=6hjtfh1ddmn4afj4c29ddijj32&response_type=token&scope=email+openid+phone+profile&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Fdashboard'; }; return ( diff --git a/server/src/server.ts b/server/src/server.ts index 9fcf851..106259d 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -32,7 +32,7 @@ app.use('*', (req, res) => { app.use(ErrorHandler); app.listen(PORT, () => { - console.log(`Server Online and listening on PORT ${PORT}`); + console.log(`Server: Listening on PORT ${PORT}`); }); export default app;