Chore: clean-up and refactor

This commit is contained in:
Arkaprabha Chakraborty
2024-08-12 18:44:02 +05:30
parent 1a34236f2f
commit 6b39bfd435
5 changed files with 16 additions and 17 deletions

View File

@@ -9,7 +9,7 @@ export async function GET(request, { params }) {
try {
const response = await axios.get(
`${process.env.NEXT_PUBLIC_BACKEND_URL}/reduce/${id}`,
`${process.env.NEXT_PUBLIC_BACKEND_URL}/reduce/${id}`
);
if (response.status === 200) {
return NextResponse.redirect(response.data.long_url);

View File

@@ -8,7 +8,7 @@ const inter = Inter({ subsets: ["latin"] });
export const metadata = {
title: "Reduce",
description: "A simple URL shortener application",
description: "A simple URL shortener application.",
icons: {
icon: "/favicon.ico",
},

View File

@@ -25,7 +25,7 @@ export default function Home() {
{
long_url: longUrl,
base_url: baseURL,
},
}
);
setShortUrl(response.data.short_url);

View File

@@ -9,6 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@types/react": "^18.3.3",
"axios": "^1.7.3",
"dotenv": "^16.4.5",
"next": "14.2.5",

View File

@@ -1,18 +1,16 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {
backgroundImage: {
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
"gradient-conic":
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
},
export const content = [
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}",
];
export const theme = {
extend: {
backgroundImage: {
"gradient-radial": "radial-gradient(var(--tw-gradient-stops))",
"gradient-conic":
"conic-gradient(from 180deg at 50% 50%, var(--tw-gradient-stops))",
},
},
plugins: [],
};
export const plugins = [];