Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Administrator
/
chatgpt.ai-pro.org
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
3
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
8b0ccf90
authored
2023-02-03 16:14:00 +0800
by
RSA
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixes
1 parent
57432129
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
6 deletions
.gitignore
README.md
client/README.md
client/env-template
client/src/App.js
env-template
.gitignore
View file @
8b0ccf9
node_modules
.env
\ No newline at end of file
...
...
README.md
View file @
8b0ccf9
...
...
@@ -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
...
...
client/README.md
View file @
8b0ccf9
...
...
@@ -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:
...
...
client/env-template
0 → 100644
View file @
8b0ccf9
REACT_APP_SERVER_URL=
\ No newline at end of file
client/src/App.js
View file @
8b0ccf9
...
...
@@ -26,7 +26,7 @@ function App() {
}
function
getEngines
(){
fetch
(
process
.
env
.
SERVER_URL
+
"
models"
)
fetch
(
process
.
env
.
REACT_APP_SERVER_URL
+
"/
models"
)
.
then
(
res
=>
res
.
json
())
.
then
(
data
=>
{
console
.
log
(
data
.
models
.
data
)
...
...
@@ -48,7 +48,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
(
process
.
env
.
SERVER_URL
+
"
api"
,
{
const
response
=
await
fetch
(
process
.
env
.
REACT_APP_SERVER_URL
+
"/
api"
,
{
method
:
"POST"
,
headers
:
{
"Content-Type"
:
"application/json"
...
...
env-template
View file @
8b0ccf9
OPENAI_API_ORG=
OPENAI_API_KEY=
\ No newline at end of file
SERVER_URL=
\ No newline at end of file
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment