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:
parent
42e99cb1c5
commit
6c037dd734
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Reference in New Issue