letterm commited on
Commit
339fb03
·
verified ·
1 Parent(s): b2638c3

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -2
index.js CHANGED
@@ -481,7 +481,7 @@ app.use(express.json({ limit: CONFIG.SERVER.BODY_LIMIT }));
481
  app.use(express.urlencoded({ extended: true, limit: CONFIG.SERVER.BODY_LIMIT }));
482
 
483
  // API 路由
484
- app.get('/v1/models', (req, res) => {
485
  res.json({
486
  object: "list",
487
  data: Object.keys(CONFIG.MODELS).map(model => ({
@@ -493,7 +493,7 @@ app.get('/v1/models', (req, res) => {
493
  });
494
  });
495
 
496
- app.post('/v1/chat/completions', async (req, res) => {
497
  try {
498
  const authToken = req.headers.authorization?.replace('Bearer ', '');
499
  if (authToken !== CONFIG.API.API_KEY) {
 
481
  app.use(express.urlencoded({ extended: true, limit: CONFIG.SERVER.BODY_LIMIT }));
482
 
483
  // API 路由
484
+ app.get('/hf/v1/models', (req, res) => {
485
  res.json({
486
  object: "list",
487
  data: Object.keys(CONFIG.MODELS).map(model => ({
 
493
  });
494
  });
495
 
496
+ app.post('/hf/v1/chat/completions', async (req, res) => {
497
  try {
498
  const authToken = req.headers.authorization?.replace('Bearer ', '');
499
  if (authToken !== CONFIG.API.API_KEY) {