Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
84eea95
fix(docs): add FastHTTP Postgres sample run and test instructions
Srinu346 Jan 27, 2026
8ec64c2
fix(docs): add FastHTTP Postgres sample run and test instructions
Srinu346 Jan 27, 2026
812d106
fix(docs): add FastHTTP Postgres sample run and test instructions
Srinu346 Jan 29, 2026
6405ef0
Merge branch 'main' into fix/quickstart-settings
Srinu346 Jan 29, 2026
c970575
fix(docs): add FastHTTP Postgres sample run and test instructions
Srinu346 Jan 29, 2026
31553ca
Merge branch 'main' into fix/quickstart-settings
Srinu346 Feb 2, 2026
78bd363
fix(docs): add FastHTTP Postgres sample run and test instructions
Srinu346 Feb 2, 2026
09a29aa
Merge branch 'fix/quickstart-settings' of https://github.com/Srinu346…
Srinu346 Feb 2, 2026
11b5fae
fix(docs): add FastHTTP Postgres sample run and test instructions
Srinu346 Feb 2, 2026
9486b41
fix(docs): add FastHTTP Postgres sample run and test instructions
Srinu346 Feb 2, 2026
7a97d1b
fix(docs): restore removed content and add Keploy test images
Srinu346 Feb 3, 2026
169ef51
fix(docs): added Keploy images and preserved wsl section
Srinu346 Feb 4, 2026
de87140
fix(docs-ui): improve responsive layout for prev/next navigation card…
kams05-ops Feb 4, 2026
3790292
Merge branch 'main' into fix/quickstart-settings
Srinu346 Feb 11, 2026
0f3d669
Merge branch 'main' into fix/quickstart-settings
Srinu346 Feb 12, 2026
e616ea2
fix(docs): remove redundant line
Srinu346 Feb 12, 2026
540bcfb
Merge branch 'fix/quickstart-settings' of https://github.com/Srinu346…
Srinu346 Feb 12, 2026
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
2 changes: 0 additions & 2 deletions src/components/QuickStartList.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ const quickstarts = [
link: "/docs/quickstart/samples-mysql/#running-app-locally-on-linuxwsl-",
},

/*
{
title: "FastHttp + Postgres",
language: "Go",
Expand All @@ -158,7 +157,6 @@ const quickstarts = [
"A sample CRUD application to demonstrate how seamlessly Keploy integrates with FastHttp and Postgres.",
link: "/docs/quickstart/samples-fasthttp/#using-docker-compose-",
},
*/

{
title: "FastHttp + Postgres",
Expand Down
100 changes: 78 additions & 22 deletions versioned_docs/version-4.0.0/quickstart/go-fasthttp-postgres.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,28 +37,85 @@ This guide walks you through generating tests and DB mocks for a sample CRUD app
git clone https://github.com/keploy/samples-go.git && cd samples-go/fasthttp-postgres
go mod download
```
We can run the application in two ways:

We'll be running our sample application right on Linux, but just to make things a tad more thrilling, we'll have the database (Postgres) chill on Docker. Ready? Let's get the party started! 🎉
1. Run with Docker
2. Run without Docker

#### Point the app to local Postgres
### Option 1: Run with Docker

Update the Postgres URL to `localhost:5432` in `app.go` (mentioned at line 21 in the sample).
#### Capture testcases:
```shell
keploy record -c "docker compose up" --container-name=fasthttp_app
```

#### Start Postgres
Keep an eye out for the `-c` flag! It's the command charm to run the app. Whether you're using `docker compose up` or `go run main.go`, it's your call.

```bash
docker compose up postgres
If you're seeing logs that resemble the ones below, you're on the right track:

<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/Keploy_record_fastapi_golang.png" alt="Sample Keploy Record" width="100%" style={{ borderRadius: '5px' }} />

Alright! With the app alive and kicking, let's weave some test cases. Making some API calls! Postman, Hoppscotch,

or even the classic curl - take your pick!

Time to create some users and books:

##### To genereate testcases we just need to make some API calls. You can use [Postman](https://www.postman.com/), [Hoppscotch](https://hoppscotch.io/), or simply `curl`: -

###### 1. Post Requests
```shell
curl -X POST -H "Content-Type: application/json" -d '{"name":"Author Name"}' http://localhost:8080/authors
```

#### Record with Keploy while running the app
```shell
curl -X POST -H "Content-Type: application/json" -d '{"title":"Book Title","author_id":1}' http://localhost:8080/books
```

###### 2. Get Requests
```bash
go build -o app
curl -i http://localhost:8080/books
```

### Lights, Camera, Record! 🎥
#### Run captured tests:

Now that we have our testcase captured, run the test file.


```shell
keploy test -c "docker compose up" --container-name=fasthttp_app --delay 10
```
When all is said and done, your test results should look a little something like this:

<img src="https://keploy-devrel.s3.us-west-2.amazonaws.com/keploy_replay_test_fastapi_golang.png" alt="Sample Keploy Replay" width="100%" style={{ borderRadius: '5px' }} />

### Option 2: Run Without Docker

> Note: This application requires the following database environment variables
> to be set in order to run correctly.
>
> Create a .env file in this directory with the following values:
>
> ```env
> DB_HOST=localhost
> DB_PORT=5432
> DB_USER=postgres
> DB_PASSWORD=password
> DB_NAME=db
> ```

#### Start the Postgres container:
```bash
docker compose up -d postgres
```

### Build the Application
```bash
go build -o app
```

#### Capture testcases:
```shell
keploy record -c "./app"
```

Expand All @@ -74,33 +131,32 @@ or even the classic curl - take your pick!

Time to create some users and books:

### Generate traffic
> Note: The server would be running on http://localhost:8080

#### Post Requests

```bash
curl -X POST -H "Content-Type: application/json" -d '{"name":"Author Name"}' http://localhost:8080/authors
##### To genereate testcases we just need to make some API calls. You can use [Postman](https://www.postman.com/), [Hoppscotch](https://hoppscotch.io/), or simply `curl`: -

###### 1. Post Requests
```shell
curl -X POST -H "Content-Type: application/json" -d '{"name":"Author Name"}' http://localhost:8080/authors
```

```bash
```shell
curl -X POST -H "Content-Type: application/json" -d '{"title":"Book Title","author_id":1}' http://localhost:8080/books
```

#### Get Request

###### 2. Get Requests
```bash
curl -i http://localhost:8080/books
```

Look at you go! With a few simple API calls, you've crafted test cases with mocks! Peek into the Keploy directory and behold the freshly minted `test-1.yml` and `mocks.yml`.

### 🏃‍♀️ Run the Tests!

Time to put it all to the test:
#### Run captured tests

```bash
keploy test -c "./app" --delay 5
Now that we have our testcase captured, run the test file.

```shell
keploy test -c "./app" --delay 10
```

> That `--delay` flag? Just a little pause (in seconds) to let your app catch its breath before the test cases start rolling in.
Expand Down
Loading