letterm commited on
Commit
d7a827e
·
verified ·
1 Parent(s): bbebe92

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +2 -2
index.js CHANGED
@@ -604,7 +604,7 @@ app.use(express.json({ limit: CONFIG.SERVER.BODY_LIMIT }));
604
  app.use(express.urlencoded({ extended: true, limit: CONFIG.SERVER.BODY_LIMIT }));
605
 
606
  // API 路由
607
- app.get('/v1/models', (req, res) => {
608
  res.json({
609
  object: "list",
610
  data: Object.keys(CONFIG.MODELS).map(model => ({
@@ -615,7 +615,7 @@ app.get('/v1/models', (req, res) => {
615
  }))
616
  });
617
  });
618
- app.post('/v1/chat/completions', async (req, res) => {
619
  try {
620
  const authToken = req.headers.authorization?.replace('Bearer ', '');
621
  if (authToken !== CONFIG.API.API_KEY) {
 
604
  app.use(express.urlencoded({ extended: true, limit: CONFIG.SERVER.BODY_LIMIT }));
605
 
606
  // API 路由
607
+ app.get('/hf/v1/models', (req, res) => {
608
  res.json({
609
  object: "list",
610
  data: Object.keys(CONFIG.MODELS).map(model => ({
 
615
  }))
616
  });
617
  });
618
+ app.post('/hf/v1/chat/completions', async (req, res) => {
619
  try {
620
  const authToken = req.headers.authorization?.replace('Bearer ', '');
621
  if (authToken !== CONFIG.API.API_KEY) {