Skip to content

Commit

Permalink
feat: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeraj319 committed Dec 30, 2023
1 parent 63968dd commit d603ac8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ Another router for the net/http module

## Get Started

```go
```golang
package main

import (
"fmt"
"github.com/Neeraj319/nirajan"
"net/http"

"github.com/Neeraj319/nirajan"
)

type Params struct {
Expand All @@ -24,18 +25,18 @@ func Home(w http.ResponseWriter, r *http.Request, params Params) {
fmt.Fprintf(w, response_string)
}


func Index(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "index response")
fmt.Println(nirajan.QueryParams(r))
fmt.Fprintf(w, "index response")
}

func main() {
r := nirajan.CreateRouter()
r.AddRoute("/:Name/:Age", Home, nirajan.GET)
r.AddRoute("/", Index, nirajan.GET)
http.ListenAndServe("0.0.0.0:8080", r)
}

}
```

- in the memory of nirajan dhakal (he is not dead)

0 comments on commit d603ac8

Please sign in to comment.