Skip to content

Commit

Permalink
Merge pull request #124 from Abhash-Chakraborty/Abhash/test
Browse files Browse the repository at this point in the history
⬆️ Moved image route to API folder for better code structure #123
  • Loading branch information
vansh-codes authored Jan 14, 2025
2 parents c4ae6cb + 327a6bf commit c3e6812
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 0 deletions.
8 changes: 8 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
async rewrites() {
return [
{
source: '/:username/image',
destination: '/api/image',
},
]
},
images: {
remotePatterns: [
{
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/ai/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ interface ResponseData {
error?: string;
}

export const runtime = 'edge';

export const POST = async (request: Request): Promise<NextResponse> => {
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY!);

Expand Down
2 changes: 2 additions & 0 deletions src/app/api/config/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ type Config = {
issue_count: number;
};

export const runtime = 'edge';

export async function POST(request: Request): Promise<Response> {
try {
const { username }: { username: string } = await request.json();
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/generate_tagline/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ interface ApiResponse {
error?: string;
}

export const runtime = 'edge';

export async function POST(request: Request): Promise<Response> {
try {
const { username, Languages, Description, config }: GenerateTaglineParams = await request.json();
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/github_profile/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ interface GitHubRepo {
name: string;
}

export const runtime = 'edge';

export async function POST(request: Request): Promise<Response> {
try {
const { username }: { username: string } = await request.json();
Expand Down
File renamed without changes.
2 changes: 2 additions & 0 deletions src/app/api/user/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { NextResponse } from 'next/server'
import { RequestBody } from './interface'

export const runtime = 'edge';

export async function POST(req: Request): Promise<NextResponse> {
const { username }: RequestBody = await req.json()

Expand Down

0 comments on commit c3e6812

Please sign in to comment.