fix: remove xlog api proxy

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei
2024-01-04 17:04:09 +08:00
parent 00c04621ab
commit 91aa77181a
4 changed files with 1 additions and 49 deletions

View File

@@ -1,4 +1,3 @@
import { builtInSnippets } from './built-in'
import { xLogPackSnippets } from './xlog'
export const allBuiltInSnippetPack = [...xLogPackSnippets, ...builtInSnippets]
export const allBuiltInSnippetPack = [...builtInSnippets]

View File

@@ -1,23 +0,0 @@
import { defineBuiltInSnippetConfig } from '../../function.types'
export default defineBuiltInSnippetConfig({
name: 'getPageId',
method: 'GET',
code: `import axios from 'axios';
export default async function handler(ctx: Context) {
const { req } = ctx
const { query } = req
const { slug, characterId } = query
return axios.get('https://xlog.app/api/slug2id', {
params: {
slug, characterId
},
headers: {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:14.2) Gecko/20100101 Firefox/14.2.1"
}
}).then(data => data.data).catch(err => ({ err }))
}`,
path: 'get_page_id',
reference: 'xlog',
})

View File

@@ -1,20 +0,0 @@
import { defineBuiltInSnippetConfig } from '../../function.types'
export default defineBuiltInSnippetConfig({
name: 'getSummary',
method: 'GET',
code: `import axios from 'axios';
export default async function handler(ctx: Context) {
const { req } = ctx
const { query } = req
const { cid, lang } = query
return axios.get('https://xlog.app/api/summary', {
params: {
cid, lang: lang || 'zh-CN'
}
}).then(data => data.data).catch(err => ({ err }))
}`,
path: 'get_summary',
reference: 'xlog',
})

View File

@@ -1,4 +0,0 @@
import get_page_id from './get_page_id'
import get_summary from './get_summary'
export const xLogPackSnippets = [get_page_id, get_summary]