Skip to content

Commit

Permalink
update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
egregors authored Jul 14, 2024
1 parent a921d32 commit 9f0c317
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,21 +165,40 @@ You can use it to protect routes that require authentication:
```go
mux := http.NewServeMux()
mux.HandleFunc("/private", func (w http.ResponseWriter, r *http.Request) {
// render html from web/private.html
http.ServeFile(w, r, "./_example/web/private.html")
// render html from web/private.html
http.ServeFile(w, r, "./_example/web/private.html")
})

withAuth := passkey.Auth(storage)
mux.Handle("/private", withAuth(privateMux))
```

## Development

### Generate Mocks
### Common tasks

To common dev task just use `make`:

```bash
➜ passkey git:(main) make help
Usage: make [task]

task help
------ ----

lint Lint the files
test Run unittests
run Run example project
gen Generate mocks
update-go-deps Updating Go dependencies

help Show help message
```

### Mocks

Use [mockery](https://github.com/vektra/mockery) to generate mocks for interfaces.

```bash
mockery
```
## License
Expand Down

0 comments on commit 9f0c317

Please sign in to comment.