6f703e28 by RSA

WIP

2 parents 39ddb93b 8b0ccf90
node_modules
\ No newline at end of file
node_modules
.env
\ No newline at end of file
......
......@@ -10,12 +10,15 @@ Create an .env file in the root directory of your application.
Duplicate the env-template and rename to .env
In the .env file, define the environment variables you want to use in your application. ex.
API_KEY="sk-xxxxxxxx"
API_ORG="org-xxxxxxx"
SERVER_URL="http://localhost:3080/"
`API_KEY="sk-xxxxxxxx"`
`API_ORG="org-xxxxxxx"`
## Run server
Run server on the root directory
`node index.js`
### Additional Configuration
After running server, proceed to /client README.md for instructions
\ No newline at end of file
......
......@@ -6,6 +6,15 @@ This project was bootstrapped with [Create React App](https://github.com/faceboo
npm install on the /client directory.
## Create ENV Variables
Create an .env file in the /client directory of your application.
Duplicate the env-template and rename to .env
In the .env file, define the environment variables you want to use in your application. ex.
REACT_APP_SERVER_URL=http://xxxxxx/
## Available Scripts
In the /client directory, you can run:
......
REACT_APP_SERVER_URL=
\ No newline at end of file
......@@ -25,7 +25,7 @@ function App() {
}
function getEngines(){
fetch("http://localhost:3080/models")
fetch(process.env.REACT_APP_SERVER_URL + "/models")
.then(res => res.json())
.then(data => {
// console.log(data.models.data)
......@@ -47,7 +47,7 @@ function App() {
// fetch response to the api combining the chat log array of messages and seinding it as a message to localhost:3000 as a post
const messages = chatLogNew.map((message) => message.message).join("\n")
const response = await fetch("http://localhost:3080/api", {
const response = await fetch(process.env.REACT_APP_SERVER_URL + "/api", {
method: "POST",
headers: {
"Content-Type": "application/json"
......
OPENAI_API_ORG=
OPENAI_API_KEY=
SERVER_URL=
\ No newline at end of file
OPENAI_API_KEY=
\ No newline at end of file
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!