4e52ac79 by Janis

improved

1 parent 9a16f34b
...@@ -3574,6 +3574,28 @@ ...@@ -3574,6 +3574,28 @@
3574 "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.6.3.tgz", 3574 "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.6.3.tgz",
3575 "integrity": "sha512-/BQzOX780JhsxDnPpH4ZiyrJAzcd8AfzFPkv+89veFSr1rcMjuq2JDCwypKaPeB6ljHp9KjXhPpjgCvQlWYuqg==" 3575 "integrity": "sha512-/BQzOX780JhsxDnPpH4ZiyrJAzcd8AfzFPkv+89veFSr1rcMjuq2JDCwypKaPeB6ljHp9KjXhPpjgCvQlWYuqg=="
3576 }, 3576 },
3577 "axios": {
3578 "version": "1.3.2",
3579 "resolved": "https://registry.npmjs.org/axios/-/axios-1.3.2.tgz",
3580 "integrity": "sha512-1M3O703bYqYuPhbHeya5bnhpYVsDDRyQSabNja04mZtboLNSuZ4YrltestrLXfHgmzua4TpUqRiVKbiQuo2epw==",
3581 "requires": {
3582 "follow-redirects": "^1.15.0",
3583 "form-data": "^4.0.0",
3584 "proxy-from-env": "^1.1.0"
3585 },
3586 "dependencies": {
3587 "form-data": {
3588 "version": "4.0.0",
3589 "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
3590 "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
3591 "requires": {
3592 "asynckit": "^0.4.0",
3593 "combined-stream": "^1.0.8",
3594 "mime-types": "^2.1.12"
3595 }
3596 }
3597 }
3598 },
3577 "axobject-query": { 3599 "axobject-query": {
3578 "version": "3.1.1", 3600 "version": "3.1.1",
3579 "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz", 3601 "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-3.1.1.tgz",
...@@ -4863,9 +4885,9 @@ ...@@ -4863,9 +4885,9 @@
4863 } 4885 }
4864 }, 4886 },
4865 "dotenv": { 4887 "dotenv": {
4866 "version": "10.0.0", 4888 "version": "16.0.3",
4867 "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", 4889 "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz",
4868 "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==" 4890 "integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ=="
4869 }, 4891 },
4870 "dotenv-expand": { 4892 "dotenv-expand": {
4871 "version": "5.1.0", 4893 "version": "5.1.0",
...@@ -10344,6 +10366,11 @@ ...@@ -10344,6 +10366,11 @@
10344 } 10366 }
10345 } 10367 }
10346 }, 10368 },
10369 "proxy-from-env": {
10370 "version": "1.1.0",
10371 "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
10372 "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
10373 },
10347 "psl": { 10374 "psl": {
10348 "version": "1.9.0", 10375 "version": "1.9.0",
10349 "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", 10376 "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz",
...@@ -10571,6 +10598,13 @@ ...@@ -10571,6 +10598,13 @@
10571 "webpack-dev-server": "^4.6.0", 10598 "webpack-dev-server": "^4.6.0",
10572 "webpack-manifest-plugin": "^4.0.2", 10599 "webpack-manifest-plugin": "^4.0.2",
10573 "workbox-webpack-plugin": "^6.4.1" 10600 "workbox-webpack-plugin": "^6.4.1"
10601 },
10602 "dependencies": {
10603 "dotenv": {
10604 "version": "10.0.0",
10605 "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz",
10606 "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q=="
10607 }
10574 } 10608 }
10575 }, 10609 },
10576 "read-cache": { 10610 "read-cache": {
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
6 "@testing-library/jest-dom": "^5.16.5", 6 "@testing-library/jest-dom": "^5.16.5",
7 "@testing-library/react": "^13.4.0", 7 "@testing-library/react": "^13.4.0",
8 "@testing-library/user-event": "^13.5.0", 8 "@testing-library/user-event": "^13.5.0",
9 "dotenv": "^16.0.3",
9 "react": "^18.2.0", 10 "react": "^18.2.0",
10 "react-dom": "^18.2.0", 11 "react-dom": "^18.2.0",
11 "react-scripts": "5.0.1", 12 "react-scripts": "5.0.1",
......
...@@ -5,6 +5,9 @@ import { useState, useEffect } from 'react'; ...@@ -5,6 +5,9 @@ import { useState, useEffect } from 'react';
5 import SideMenu from './SideMenu' 5 import SideMenu from './SideMenu'
6 import ChatBox from './ChatBox' 6 import ChatBox from './ChatBox'
7 7
8 const modelUrl = process.env.REACT_APP_MODEL_URL;
9 const apiUrl = process.env.REACT_APP_API_URL;
10
8 function App() { 11 function App() {
9 12
10 useEffect(() => { 13 useEffect(() => {
...@@ -26,7 +29,7 @@ function App() { ...@@ -26,7 +29,7 @@ function App() {
26 } 29 }
27 30
28 function getEngines(){ 31 function getEngines(){
29 fetch(process.env.SERVER_URL + "models") 32 fetch(modelUrl)
30 .then(res => res.json()) 33 .then(res => res.json())
31 .then(data => { 34 .then(data => {
32 console.log(data.models.data) 35 console.log(data.models.data)
...@@ -48,10 +51,11 @@ function App() { ...@@ -48,10 +51,11 @@ function App() {
48 // fetch response to the api combining the chat log array of messages and seinding it as a message to localhost:3000 as a post 51 // fetch response to the api combining the chat log array of messages and seinding it as a message to localhost:3000 as a post
49 const messages = chatLogNew.map((message) => message.message).join("\n") 52 const messages = chatLogNew.map((message) => message.message).join("\n")
50 53
51 const response = await fetch(process.env.SERVER_URL + "api", { 54 const response = await fetch(apiUrl, {
52 method: "POST", 55 method: "POST",
53 headers: { 56 headers: {
54 "Content-Type": "application/json" 57 "Content-Type": "application/json",
58 "Access-Control-Allow-Origin": "*"
55 }, 59 },
56 body: JSON.stringify({ 60 body: JSON.stringify({
57 message: messages, 61 message: messages,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!