Update server.js
Browse files
server.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
| 3 |
import express from 'express';
|
| 4 |
import { CAINode } from 'cainode';
|
| 5 |
import bodyParser from "body-parser";
|
|
|
|
| 6 |
|
| 7 |
const app = express();
|
| 8 |
const PORT = 7860;
|
|
@@ -11,7 +12,7 @@ app.use(bodyParser.json());
|
|
| 11 |
|
| 12 |
// API endpoint for chatting
|
| 13 |
app.get('/chat', async (req, res) => {
|
| 14 |
-
const token = req.query.token ||
|
| 15 |
const characterId = req.query.characterId || 'smtV3Vyez6ODkwS8BErmBAdgGNj-1XWU73wIFVOY1hQ';
|
| 16 |
const chatId = req.query.chatId;
|
| 17 |
const voiceId = req.query.voiceId || 'f4b33b1d-2e5a-40a8-8a07-958140cd104d';
|
|
|
|
| 3 |
import express from 'express';
|
| 4 |
import { CAINode } from 'cainode';
|
| 5 |
import bodyParser from "body-parser";
|
| 6 |
+
import os
|
| 7 |
|
| 8 |
const app = express();
|
| 9 |
const PORT = 7860;
|
|
|
|
| 12 |
|
| 13 |
// API endpoint for chatting
|
| 14 |
app.get('/chat', async (req, res) => {
|
| 15 |
+
const token = req.query.token || os.getenv("token")
|
| 16 |
const characterId = req.query.characterId || 'smtV3Vyez6ODkwS8BErmBAdgGNj-1XWU73wIFVOY1hQ';
|
| 17 |
const chatId = req.query.chatId;
|
| 18 |
const voiceId = req.query.voiceId || 'f4b33b1d-2e5a-40a8-8a07-958140cd104d';
|