Skip to content

Commit df91786

Browse files
authored
Merge pull request #8 from deapi-ai/copilot/sub-pr-3-one-more-time
fix: align Node.js requirements and validate metadata URLs
2 parents 0e0e38a + 403d7fd commit df91786

4 files changed

Lines changed: 21 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
node-version: ['18.x', '20.x']
14+
node-version: ['18.18.x', '20.x']
1515
steps:
1616
- uses: actions/checkout@v4
1717

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# deAPI Tester
22

33
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4-
[![Node.js 18+](https://img.shields.io/badge/Node.js-18%2B-green.svg)](https://nodejs.org/)
4+
[![Node.js 18.18.0+](https://img.shields.io/badge/Node.js-18.18.0%2B-green.svg)](https://nodejs.org/)
55
[![Next.js 15](https://img.shields.io/badge/Next.js-15-black.svg)](https://nextjs.org/)
66
[![Docker](https://img.shields.io/badge/Docker-ready-blue.svg)](https://www.docker.com/)
77

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
"url": "https://deapi.ai"
88
},
99
"license": "MIT",
10+
"engines": {
11+
"node": ">=18.18.0"
12+
},
1013
"repository": {
1114
"type": "git",
1215
"url": "https://github.com/deapi-ai/deapi-tester.git"

src/app/layout.tsx

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,23 @@ import type { Metadata } from 'next';
22
import './globals.css';
33
import { Providers } from '@/components/Providers';
44

5+
function getMetadataBaseUrl(): string {
6+
const siteUrl = process.env.NEXT_PUBLIC_SITE_URL;
7+
if (!siteUrl) {
8+
return 'http://localhost:3000';
9+
}
10+
// Ensure URL has a protocol
11+
if (!/^https?:\/\//i.test(siteUrl)) {
12+
console.warn(
13+
`NEXT_PUBLIC_SITE_URL ('${siteUrl}') missing protocol. Using default: http://localhost:3000`
14+
);
15+
return 'http://localhost:3000';
16+
}
17+
return siteUrl;
18+
}
19+
520
export const metadata: Metadata = {
6-
metadataBase: new URL(
7-
process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3000'
8-
),
21+
metadataBase: new URL(getMetadataBaseUrl()),
922
title: 'deAPI Tester — Test AI Inference Endpoints',
1023
description:
1124
'Local developer tool for testing deAPI.ai endpoints. Generate images, videos, audio and more with dynamic forms, async job tracking, and result preview.',
@@ -24,7 +37,6 @@ export const metadata: Metadata = {
2437
description:
2538
'Test deAPI.ai endpoints locally with dynamic forms, async job tracking, price calculator and result preview.',
2639
type: 'website',
27-
url: 'https://github.com/deapi-ai/deapi-tester',
2840
siteName: 'deAPI Tester',
2941
images: ['/og-image.png'],
3042
},

0 commit comments

Comments
 (0)