fix(route/apnews): Change default path for mobile API (#22105)

* fix(route/apnews): Change default path for mobile API

* Update mobile-api.ts

* Update mobile-api.ts
This commit is contained in:
Andvari 2026-06-04 21:15:03 +08:00 committed by GitHub
parent 42e99cb1c5
commit 6c037dd734
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -10,12 +10,12 @@ import { fetchArticle } from './utils';
export const route: Route = {
path: '/mobile/:path{.+}?',
categories: ['traditional-media'],
example: '/apnews/mobile/ap-top-news',
example: '/apnews/mobile',
view: ViewType.Articles,
parameters: {
path: {
description: 'Corresponding path from AP News website',
default: 'ap-top-news',
default: '/',
},
},
features: {
@ -37,7 +37,7 @@ export const route: Route = {
};
async function handler(ctx) {
const path = ctx.req.param('path') ? `/${ctx.req.param('path')}` : '/hub/ap-top-news';
const path = ctx.req.param('path') ? `/${ctx.req.param('path')}` : '/';
const apiRootUrl = 'https://apnews.com/graphql/delivery/ap/v1';
const res = await ofetch(apiRootUrl, {
query: {