github-actions[bot] commited on
Commit
5c6d52e
·
1 Parent(s): 097ff58

Update from GitHub Actions

Browse files
Files changed (1) hide show
  1. index.ts +10 -2
index.ts CHANGED
@@ -17,7 +17,8 @@ import { dirname } from 'path'
17
  import { onRequest as handleAccount } from './functions/api/account.js'
18
  import { onRequest as handleLogin } from './functions/api/login.js'
19
  import { onRequest as handleSetting } from './functions/api/setting.js'
20
-
 
21
 
22
  dotenv.config({ path: ['.env', '.env.local'], override: true });
23
  const isDev = process.env.NODE_ENV === 'development'
@@ -51,7 +52,7 @@ var kv: KVNamespace = {
51
  put: async (key: string, value: string) => {
52
  await storage.setItem(key, value);
53
  },
54
- delete:async(key:string)=>{
55
  await storage.removeItem(key);
56
  }
57
  };
@@ -129,6 +130,13 @@ app.all('/api/*', async (c) => {
129
  response = await handleSetting(context);
130
  break;
131
  default:
 
 
 
 
 
 
 
132
  return c.json({ error: 'Route not found' }, 404);
133
  }
134
  return response;
 
17
  import { onRequest as handleAccount } from './functions/api/account.js'
18
  import { onRequest as handleLogin } from './functions/api/login.js'
19
  import { onRequest as handleSetting } from './functions/api/setting.js'
20
+ import { onRequest as handleGithub } from './functions/api/github/[[path]].js'
21
+ import { onRequest as handleHF } from './functions/api/hf/[[path]].js'
22
 
23
  dotenv.config({ path: ['.env', '.env.local'], override: true });
24
  const isDev = process.env.NODE_ENV === 'development'
 
52
  put: async (key: string, value: string) => {
53
  await storage.setItem(key, value);
54
  },
55
+ delete: async (key: string) => {
56
  await storage.removeItem(key);
57
  }
58
  };
 
130
  response = await handleSetting(context);
131
  break;
132
  default:
133
+ if (path.startsWith('/api/github/')) {
134
+ response = await handleGithub(context);
135
+ break;
136
+ } else if (path.startsWith('/api/hf/')) {
137
+ response = await handleHF(context);
138
+ break;
139
+ }
140
  return c.json({ error: 'Route not found' }, 404);
141
  }
142
  return response;