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