parent
13b7ed1152
commit
e545305fb4
@ -1,43 +1,4 @@
|
||||
# Run code
|
||||
# Run solution
|
||||
|
||||
|
||||
|
||||
## Set up
|
||||
|
||||
Create virtual environment
|
||||
|
||||
```sh
|
||||
cd backend
|
||||
python -m venv venv
|
||||
source ./venv/bin/activate
|
||||
```
|
||||
|
||||
## Install dependencies
|
||||
|
||||
```sh
|
||||
pip install openai flask flask-cors
|
||||
```
|
||||
|
||||
## Run API
|
||||
|
||||
```sh
|
||||
python api.py
|
||||
```
|
||||
|
||||
## Run frontend
|
||||
|
||||
Make sure you stand in the frontend folder
|
||||
|
||||
Locate *app.js*, change `BASE_URL` to that of your backend URL
|
||||
|
||||
Run it
|
||||
|
||||
```
|
||||
npx http-server -p 8000
|
||||
```
|
||||
|
||||
Try typing a message in the chat, you should see a response (providing you're running this in a Codespace or have set up a access token).
|
||||
|
||||
## Set up access token (if you don't run this in a Codespace)
|
||||
|
||||
See [Set up PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
|
||||
1. Start up the [backend](./backend/README.md)
|
||||
1. Now start the [fronten](./frontend/README.md)
|
@ -0,0 +1,3 @@
|
||||
Choose your runtime
|
||||
|
||||
- [Python](./python/README.md)
|
@ -0,0 +1,42 @@
|
||||
# Run code
|
||||
|
||||
|
||||
|
||||
## Set up
|
||||
|
||||
Create virtual environment
|
||||
|
||||
```sh
|
||||
python -m venv venv
|
||||
source ./venv/bin/activate
|
||||
```
|
||||
|
||||
## Install dependencies
|
||||
|
||||
```sh
|
||||
pip install openai flask flask-cors
|
||||
```
|
||||
|
||||
## Run API
|
||||
|
||||
```sh
|
||||
python api.py
|
||||
```
|
||||
|
||||
## Run frontend
|
||||
|
||||
Make sure you stand in the frontend folder
|
||||
|
||||
Locate *app.js*, change `BASE_URL` to that of your backend URL
|
||||
|
||||
Run it
|
||||
|
||||
```
|
||||
npx http-server -p 8000
|
||||
```
|
||||
|
||||
Try typing a message in the chat, you should see a response (providing you're running this in a Codespace or have set up a access token).
|
||||
|
||||
## Set up access token (if you don't run this in a Codespace)
|
||||
|
||||
See [Set up PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
|
@ -0,0 +1,7 @@
|
||||
# Run the code
|
||||
|
||||
```sh
|
||||
npx http-server -p 3000
|
||||
```
|
||||
|
||||
Locate the `BASE_URL` in `app.js` and change it match the URL of the backend.
|
Loading…
Reference in new issue