File tree Expand file tree Collapse file tree 2 files changed +2
-21
lines changed
webapp/app/api/url-shortener Expand file tree Collapse file tree 2 files changed +2
-21
lines changed Original file line number Diff line number Diff line change 3939 run : yarn test
4040
4141 - name : Run Contract Testings
42- run : npm run test:contract
42+ run : yarn test:contract
4343
4444 - name : Restore cache Next.js build
4545 uses : actions/cache@v3
9797 run : yarn test
9898
9999 - name : Run Contract Testings
100- run : npm run test:contract
100+ run : yarn test:contract
101101
102102 - name : Build API
103103 run : yarn build
Original file line number Diff line number Diff line change @@ -14,23 +14,4 @@ export async function POST(request: NextRequest) {
1414 } catch ( error : any ) {
1515 return NextResponse . json ( { error : error . message } , { status : 400 } ) ;
1616 }
17- /*
18- return fetch('http://localhost:3000/shorten-url', {
19- method: 'POST',
20- headers: { 'Content-Type': 'application/json' },
21- body: JSON.stringify({ url }),
22- })
23- .then(async (res) => {
24- if (!res.ok)
25- throw new Error((await res.json()).error || 'Failed to shorten URL');
26- return res.json();
27- })
28- .then((data) =>
29- NextResponse.json({ shortenedUrl: data.shortenedUrl }, { status: 200 })
30- )
31- .catch((error) => {
32- console.error('Error shortening URL:', error);
33- return NextResponse.json({ error: error.message }, { status: 400 });
34- });
35- */
3617}
You can’t perform that action at this time.
0 commit comments