Skip to content

Commit

Permalink
Feat(API): Change API Endpoint and Image Optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
Ikram-Maulana committed Oct 1, 2022
1 parent b9dae3b commit 6d36ecb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 8 deletions.
12 changes: 12 additions & 0 deletions .env.vault
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#################################################################################
# #
# This file uniquely identifies your project in dotenv-vault. #
# You SHOULD commit this file to source control. #
# #
# Generated with 'npx dotenv-vault new' #
# #
# Learn more at https://dotenv.org/env-vault #
# #
#################################################################################

DOTENV_VAULT=vlt_b490c5f0f8d25c3e41046a711f6ce5e378238df467c447a8d8664131d9bcea07
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

.env*
.flaskenv*
!.env.project
!.env.vault
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"dotenv.enableAutocloaking": false
}
4 changes: 2 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,12 @@ const Home: NextPage<dataFetchProps> = ({ experiences, projects }) => {
<div className="w-full mt-0 mb-10 md:w-2/5 md:mt-0 md:mb-0">
<Image
loader={({ src }) => src}
src="https://res.cloudinary.com/ikram20/image/upload/v1664545689/portfolio/ikram_aentyz.jpg"
src="https://res.cloudinary.com/ikram20/image/upload/f_auto,q_auto/portfolio/ikram_aentyz.jpg"
alt="Ikram Maulana"
width={1440}
height={1370}
className="rb-lazy rounded-lg shadow-2xl object-cover"
unoptimized
unoptimized={true}
/>
<noscript />
</div>
Expand Down
8 changes: 2 additions & 6 deletions utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import axios from "axios";

export async function getAllExperiences() {
try {
const response = await axios.get(
"https://api.ikrammaulana.vercel.app/experiences"
);
const response = await axios.get(`${process.env.API_URL}/experiences`);
return response.data;
} catch (error) {
throw error;
Expand All @@ -13,9 +11,7 @@ export async function getAllExperiences() {

export async function getAllProjects() {
try {
const response = await axios.get(
"https://api.ikrammaulana.vercel.app/projects"
);
const response = await axios.get(`${process.env.API_URL}/projects`);
return response.data;
} catch (error) {
throw error;
Expand Down

1 comment on commit 6d36ecb

@vercel
Copy link

@vercel vercel bot commented on 6d36ecb Oct 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.