https://github.com/hngprojects/hng_boilerplate_golang_web
https://github.com/hngprojects/hng_boilerplate_golang_web
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hngprojects/hng_boilerplate_golang_web
- Owner: hngprojects
- License: apache-2.0
- Created: 2024-05-29T10:37:35.000Z (about 1 year ago)
- Default Branch: dev
- Last Pushed: 2025-03-01T15:55:36.000Z (4 months ago)
- Last Synced: 2025-03-29T18:06:17.608Z (3 months ago)
- Language: Go
- Size: 41.7 MB
- Stars: 81
- Watchers: 4
- Forks: 60
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## hng_boilerplace_golang_web
### Prerequisites
1. **Go 1.17** or **lastest version** already installed on your local machine.
2. 2 Postgresql servers (one serves as normal database server, and another for running tests). You can use a disposable docker instance for tests### Run Project from Root
1. Ensure your postgres instances are running
2. Create and populate a `app.env` file on the project root with its keys and corresponding values as listed in `app-sample.env`
3. Run from project root directory```bash
$ go run main.go
```### Testing
1. Automated unit and integration tests done with golang's builtin [`testing`](https://pkg.go.dev/testing) package.
To run one test file:
```bash
$ go test -v ./tests/ -timeout 99999s
```To run all tests:
```bash
$ go test -v ./tests// -timeout 99999s
``````bash
$ go test -v ./tests/... -timeout 99999s
```NB: Always add timeout tag to prevent early timeout