Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/koddr/tutorial-go-fiber-rest-api
π Build a RESTful API on Go: Fiber, PostgreSQL, JWT and Swagger docs in isolated Docker containers.
https://github.com/koddr/tutorial-go-fiber-rest-api
api docker fiber fiber-framework go golang jwt rest-api restful swagger tutorial tutorial-code tutorial-sourcecode tutorials
Last synced: 3 months ago
JSON representation
π Build a RESTful API on Go: Fiber, PostgreSQL, JWT and Swagger docs in isolated Docker containers.
- Host: GitHub
- URL: https://github.com/koddr/tutorial-go-fiber-rest-api
- Owner: koddr
- License: mit
- Created: 2021-03-09T14:26:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-19T15:49:54.000Z (7 months ago)
- Last Synced: 2024-06-18T17:09:13.103Z (5 months ago)
- Topics: api, docker, fiber, fiber-framework, go, golang, jwt, rest-api, restful, swagger, tutorial, tutorial-code, tutorial-sourcecode, tutorials
- Language: Go
- Homepage: https://dev.to/koddr/build-a-restful-api-on-go-fiber-postgresql-jwt-and-swagger-docs-in-isolated-docker-containers-475j
- Size: 268 KB
- Stars: 353
- Watchers: 4
- Forks: 70
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-fiber - koddr/tutorial-go-fiber-rest-api - Tutorial for building a restful api with fiber. (π Recipes / π± Third Party)
README
# π Tutorial: Build a RESTful API on Go
Fiber, PostgreSQL, JWT and Swagger docs in isolated Docker containers.
π The full article is published on **March 22, 2021**, on Dev.to: https://dev.to/koddr/build-a-restful-api-on-go-fiber-postgresql-jwt-and-swagger-docs-in-isolated-docker-containers-475j
![fiber_cover_gh](https://user-images.githubusercontent.com/11155743/112001218-cf258b00-8b2f-11eb-9c6d-d6c38a09af86.jpg)
## Quick start
1. Rename `.env.example` to `.env` and fill it with your environment values.
2. Install [Docker](https://www.docker.com/get-started) and [migrate](https://github.com/golang-migrate/migrate) tool for applying migrations.
3. Run project by this command:```bash
make docker.run# Process:
# - Generate API docs by Swagger
# - Create a new Docker network for containers
# - Build and run Docker containers (Fiber, PostgreSQL)
# - Apply database migrations (using github.com/golang-migrate/migrate)
```4. Go to your API Docs page: [127.0.0.1:5000/swagger/index.html](http://127.0.0.1:5000/swagger/index.html)
![Screenshot](https://user-images.githubusercontent.com/11155743/111976684-f15ce000-8b12-11eb-871a-8d32465900fe.png)
## P.S.
If you want more articles like this on this blog, then post a comment below and subscribe to me. Thanks! π
And, of course, you can support me by donating at [LiberaPay](https://liberapay.com/koddr/donate). _Each donation will be used to write new articles and develop non-profit open-source projects for the community._
[![Support author at LiberaPay](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zq8442cqyjq2i1jdeay8.png)](https://liberapay.com/koddr/donate)
## β οΈ License
MIT Β© [Vic ShΓ³stak](https://github.com/koddr) & [True web artisans](https://1wa.co/).
## Building:
https://levelup.gitconnected.com/a-better-way-than-ldflags-to-add-a-build-version-to-your-go-binaries-2258ce419d2d
Windows:
```
$ set CGO_ENABLED=0 && go build -ldflags="-w -s -X 'main.version=1.0.1'" .
```