Spaces:
Runtime error
Runtime error
Update index.js
Browse files
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) {
|