Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8be0615
Added go server
priankakariat Oct 4, 2024
4be4456
Added readme for go server
priankakariat Oct 4, 2024
95b2d7e
Fixed documentation and read me of go files
priankakariat Oct 4, 2024
a7bc461
Updated readme for go server
priankakariat Oct 4, 2024
0231060
Updated documentation of json.go
priankakariat Oct 4, 2024
bb41cba
Updated formatting of license in go files
priankakariat Oct 4, 2024
233135c
Added cors middleware handler to go server
priankakariat Oct 4, 2024
c2ffef4
Fixed readme for go server
priankakariat Oct 4, 2024
c0b4793
Update README.md
priankakariat Oct 4, 2024
e6ae3ac
Update README.md
priankakariat Oct 4, 2024
b6e7341
Update README.md to skip to manual install for Go
priankakariat Oct 4, 2024
6b4c610
Update README.md
priankakariat Oct 4, 2024
f8cb2af
Update README.md
priankakariat Oct 4, 2024
a4d7518
Update README.md
priankakariat Oct 4, 2024
f2328a4
Update README.md
priankakariat Oct 4, 2024
9e82320
Update README.md
priankakariat Oct 4, 2024
9e383b5
Update README.md
priankakariat Oct 4, 2024
873f294
Update README.md
priankakariat Oct 4, 2024
7f68b8d
Update README.md
priankakariat Oct 4, 2024
7235a45
Update README.md
priankakariat Oct 4, 2024
61dbb0f
Update README.md
priankakariat Oct 4, 2024
af01e1f
Update README.md
priankakariat Oct 4, 2024
54e4b23
Update README.md
priankakariat Oct 4, 2024
46a2d48
Updated documentation of main.go
priankakariat Oct 4, 2024
5c5a7fd
Merge branch 'server-go' of https://github.com/priankakariatyml/examp…
priankakariat Oct 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added readme for go server
  • Loading branch information
priankakariat committed Oct 4, 2024
commit 4be44560d015b153c1d83e528e0e1862db60aa7b
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,22 @@ python app.py
```
The server will start on `localhost:9000`.

##### Configure and run Go backend
###### Configuration
You need a Gemini API key to run the server,

If you don't have a Gemini API key ready, you can create a key with one click in [Google AI Studio](https://aistudio.google.com/app/apikey).
You must set the API key as an environment variable while running the application.

###### Running the Application
1. Navigate to the app directory, `server-go` (i.e. where main.go is located).
2. Run the application using the following command:
```
GOOGLE_API_KEY=<your_api_key> go run.
```
The server will start on `localhost:9000`.
By default, the app will run on port 9000. You can modify the port the server listens to by setting the environment variable `PORT`.

## Usage
To start using the app, visit [http://localhost:3000](http://localhost:3000/)

Expand Down
24 changes: 24 additions & 0 deletions server-go/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Gemini chat app with Go

## Install Go
To run this app Go must be installed on your system.
Check if Go is already installed.
```
go version
```
If Go is not installed, follow the instructions for your operating system from the [official Go installation guide](https://go.dev/doc/install).

## Run the application
You need a Gemini API key to run the server,

If you don't have a Gemini API key ready, you can create a key with one click in [Google AI Studio](https://aistudio.google.com/app/apikey).

1. Navigate to the app directory, `server-go` (i.e. where main.go is located).
2. Run the application with the following command:
```
GOOGLE_API_KEY=<your_api_key> PORT=<your_port> go run.
```

## Environment Variables
* GOOGLE_API_KEY: API key for Gemini service.
* PORT: The port this server is listening on (default 9000).