Skip to content

Commit cae6f51

Browse files
committed
feat: adding tests.http, using 8080
1 parent 5c07113 commit cae6f51

File tree

4 files changed

+38
-3
lines changed

4 files changed

+38
-3
lines changed

Diff for: .env.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
PORT=8000
1+
PORT=8080
22
REDIS_URL="redis://localhost:6379"

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Next, spin up docker containers:
3333
make docker
3434
```
3535

36-
You should have a server running on `http://localhost:<port>` where the port is set in your `.env` file (default is 8000). You can test the following routes:
36+
You should have a server running on `http://localhost:<port>` where the port is set in your `.env` file (default is 8080). You can test the following routes:
3737

3838
1. `GET /api/todos` - Gets all todos
3939
2. `GET /api/todos/:id` - Gets a todo by ID

Diff for: Tests.http

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@Host = http://localhost:8080
2+
3+
### Get All Todos
4+
GET {{Host}}/api/todos HTTP/1.1
5+
6+
### Search Todos
7+
8+
GET {{Host}}/api/todos/search?status=in progress HTTP/1.1
9+
10+
### Get a single todo
11+
12+
GET {{Host}}/api/todos/1 HTTP/1.1
13+
14+
### Create a todo
15+
16+
POST {{Host}}/api/todos HTTP/1.1
17+
Content-Type: application/json
18+
19+
{
20+
"id": "2",
21+
"name": "Laundry"
22+
}
23+
24+
### Update a todo
25+
26+
PATCH {{Host}}/api/todos/2 HTTP/1.1
27+
Content-Type: application/json
28+
29+
{
30+
"status": "in progress"
31+
}
32+
33+
### Delete a todo
34+
35+
DELETE {{Host}}/api/todos/2 HTTP/1.1

Diff for: cmd/config/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func getEnv(key, fallback string) string {
1919
}
2020

2121
func (c *Config) Port() string {
22-
return getEnv("PORT", "3000")
22+
return getEnv("PORT", "8080")
2323
}
2424

2525
func (c *Config) RedisUrl() string {

0 commit comments

Comments
 (0)