Skip to content

Av1shay/di-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

di-demo

di-demo is a Go project that demonstrates the fundamentals of dependency injection and separation of concerns in a Golang web server. It also showcases essential concepts such as authentication, context-based logging with traceability, and robust error handling.

Run local

Run cp .env.example .env and change the configuration in the .env file with the actual values.
Then start the server

go run main.go

Create item example

curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer 123abc" \
  --request POST \
  --data '{"name": "my-great-item", value:"Hello, World!"}' \
  http://localhost:8085/item

Get item example

curl --header "Authorization: Bearer 123abc" \
  http://localhost:8085/item/1

Run tests

go test ./...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages