mirror of
https://github.com/fmhy/edit.git
synced 2026-02-03 01:31:12 +11:00
feat(api): move to api.fmhy.net
This commit is contained in:
parent
de933602eb
commit
76c776c2eb
7 changed files with 637 additions and 35 deletions
|
|
@ -7,14 +7,16 @@ export default defineEventHandler(async (event) => {
|
|||
FeedbackSchema.parseAsync
|
||||
)
|
||||
const env = useRuntimeConfig(event)
|
||||
const { pathname } = new URL(event.node.req.url)
|
||||
|
||||
const { success } = await env.MY_RATE_LIMITER.limit({ key: pathname })
|
||||
if (!success) {
|
||||
return new Response(`429 Failure – rate limit exceeded for ${pathname}`, {
|
||||
status: 429
|
||||
})
|
||||
}
|
||||
// FIXME: somehow this is not working, but it worked before
|
||||
// const path = 'feedback'
|
||||
//
|
||||
// const { success } = await env.MY_RATE_LIMITER.limit({ key: path })
|
||||
// if (!success) {
|
||||
// return new Response('429 Failure – global rate limit exceeded', {
|
||||
// status: 429
|
||||
// })
|
||||
// }
|
||||
|
||||
let description = `${message}\n\n`
|
||||
if (page) description += `**Page:** \`${page}\``
|
||||
|
|
@ -51,7 +51,7 @@ async function handleSubmit() {
|
|||
}
|
||||
|
||||
try {
|
||||
const response = await fetch('https://feedback.tasky.workers.dev', {
|
||||
const response = await fetch('https://api.fmhy.net/feedback', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue