Skip to content

Commit

Permalink
fixed signup page
Browse files Browse the repository at this point in the history
  • Loading branch information
saalikmubeen committed Jun 4, 2024
1 parent fb31668 commit 91dab16
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@


# Goravel
[![Release](https://img.shields.io/github/release/saalikmubeen/goravel.svg?style=flat-square)](https://github.com/saalikmubeen/goravel/releases)


PHP's Laravel like web framework supercharged with Go.

Expand Down Expand Up @@ -85,10 +87,6 @@ go mod tidy

6. Run the server:

```bash
goravel serve
```
`OR`

```bash
go run ./*.go
Expand Down Expand Up @@ -147,3 +145,8 @@ You don't have to do anything. Just run this command and you are good to go.
- `goravel make session`: Generates all the necessary files for session management if you want to use database for session storage. This creates and runs migrations for session tables, again saving you from the hassle of writing boring migration files.




## License

Goravel is open-source software licensed under the [MIT license](https://opensource.org/licenses/MIT).
2 changes: 1 addition & 1 deletion cmd/goravel/copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
)

//go:embed templates
//go:embed "all:templates"
var templateFS embed.FS

func copyFilefromTemplate(from string, to string) error {
Expand Down
5 changes: 4 additions & 1 deletion cmd/goravel/templates/handlers/auth_handlers.go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ func (h *Handlers) Logout(w http.ResponseWriter, r *http.Request) {
}

func (h *Handlers) UserSignup(w http.ResponseWriter, r *http.Request) {
err := h.App.Render.Page(w, r, "signup", nil, nil)
var user = models.User{}
vars := make(jet.VarMap)
vars.Set("user", user)
err := h.App.Render.Page(w, r, "signup", vars, nil)
if err != nil {
h.App.ErrorLog.Println(err)
}
Expand Down
4 changes: 3 additions & 1 deletion cmd/goravel/templates/handlers/handler.go.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package handlers

import (
"net/http"

"github.com/saalikmubeen/goravel"
)

// $HANDLERNAME$ is a generated handler function
func (h *Handlers) $HANDLERNAME$(w http.ResponseWriter, r *http.Request) {

h.App.WriteJSON(w, http.StatusOK, map[string]interface{}{
h.App.WriteJSON(w, http.StatusOK, goravel.Response{
"data": "Happy coding!",
})

Expand Down
2 changes: 1 addition & 1 deletion cmd/goravel/templates/new/go.mod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module ${APP_URL}
go 1.22.3

require (
github.com/saalikmubeen/goravel v1.5.1
github.com/saalikmubeen/goravel v1.6.0
github.com/CloudyKit/jet/v6 v6.2.0
github.com/go-chi/chi/v5 v5.0.12
github.com/upper/db/v4 v4.7.0
Expand Down
2 changes: 1 addition & 1 deletion goravel.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (

const (
// Version of Goravel
Version = "1.5.1"
Version = "1.6.0"
// http://patorjk.com/software/taag/#p=display&f=Ogre&t=Goravel
Banner = `
___ _
Expand Down

0 comments on commit 91dab16

Please sign in to comment.