Rooni commited on
Commit
2194877
·
verified ·
1 Parent(s): d01b1a6

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +5 -5
server.js CHANGED
@@ -31,7 +31,7 @@ const start = `${process.env.start}`;
31
  const startconnect = `${process.env.startconnect}`;
32
 
33
  app.post('/update', async (req, res) => {
34
- res.json({ content: `{"error":"", "title":"Требуется обновление", "text":"Текущая версия приложения устарела. Установите новую из нашего телеграм канала: @yufi_ru", "okb":"Обновить", "oklink":"https://t.me/yufi_ru", "cancelable":"false"` });
35
  });
36
 
37
  app.post('/pl', async (req, res) => {
@@ -67,11 +67,11 @@ app.post('/pl', async (req, res) => {
67
  const content = response.data.choices[0].message.content.trim();
68
  res.json({ content });
69
  } else {
70
- res.json({ content: `{"error":"", "title":"Ошибка", "text":"Произошла ошибка на сервере. (Ошибка прочтения)", "okb":"Ок", "oklink":"", "cancelable":"true"` });
71
  }
72
  } catch (error) {
73
  console.error(error);
74
- res.json({ content: `{"error":"", "title":"Ошибка", "text":"Произошла ошибка на сервере. (Ошибка при генерации)", "okb":"Ок", "oklink":"", "cancelable":"true"` });
75
  }
76
  });
77
 
@@ -109,11 +109,11 @@ app.post('/plbeta', async (req, res) => {
109
  console.log(`\n---\nПользователь: ${prompt}\n Ответ:\n ${content}`);
110
  res.json({ content });
111
  } else {
112
- res.json({ content: `{"error":"", "title":"Ошибка", "text":"Произошла ошибка на сервере. (Ошибка прочтения)", "okb":"Ок", "oklink":"", "cancelable":"true"` });
113
  }
114
  } catch (error) {
115
  console.error(error);
116
- res.json({ content: `{"error":"", "title":"Ошибка", "text":"Произошла ошибка на сервере. (Ошибка при генерации)", "okb":"Ок", "oklink":"", "cancelable":"true"` });
117
  }
118
  });
119
 
 
31
  const startconnect = `${process.env.startconnect}`;
32
 
33
  app.post('/update', async (req, res) => {
34
+ res.json({ content: `{"error":"", "title":"Требуется обновление", "text":"Текущая версия приложения устарела. Установите новую из нашего телеграм канала: @yufi_ru", "okb":"Обновить", "oklink":"https://t.me/yufi_ru", "cancelable":"false"}` });
35
  });
36
 
37
  app.post('/pl', async (req, res) => {
 
67
  const content = response.data.choices[0].message.content.trim();
68
  res.json({ content });
69
  } else {
70
+ res.json({ content: `{"error":"", "title":"Ошибка", "text":"Произошла ошибка на сервере. (Ошибка прочтения)", "okb":"Ок", "oklink":"", "cancelable":"true"}` });
71
  }
72
  } catch (error) {
73
  console.error(error);
74
+ res.json({ content: `{"error":"", "title":"Ошибка", "text":"Произошла ошибка на сервере. (Ошибка при генерации)", "okb":"Ок", "oklink":"", "cancelable":"true"}` });
75
  }
76
  });
77
 
 
109
  console.log(`\n---\nПользователь: ${prompt}\n Ответ:\n ${content}`);
110
  res.json({ content });
111
  } else {
112
+ res.json({ content: `{"error":"", "title":"Ошибка", "text":"Произошла ошибка на сервере. (Ошибка прочтения)", "okb":"Ок", "oklink":"", "cancelable":"true"}` });
113
  }
114
  } catch (error) {
115
  console.error(error);
116
+ res.json({ content: `{"error":"", "title":"Ошибка", "text":"Произошла ошибка на сервере. (Ошибка при генерации)", "okb":"Ок", "oklink":"", "cancelable":"true"}` });
117
  }
118
  });
119