-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/64/add register login api (#76)
- Loading branch information
Showing
30 changed files
with
1,166 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# App configuration | ||
APP_ENV=development | ||
PORT=6969 | ||
|
||
# Database configuration | ||
DB_USER=postgres | ||
DB_PASSWORD=postgres | ||
DB_NAME=postgres | ||
DB_HOST=localhost | ||
DB_PORT=5432 | ||
DB_SSLMODE=disable | ||
|
||
# JWT configuration | ||
JWT_SECRET=your-jwt-secret | ||
|
||
# AWS configuration | ||
AWS_REGION=us-west-2 | ||
AWS_ACCESS_KEY_ID=your-access-key-id | ||
AWS_SECRET_ACCESS_KEY=your-secret-access-key | ||
AWS_S3_BUCKET=your-bucket-name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package middleware | ||
|
||
import ( | ||
"net/http" | ||
|
||
"github.com/labstack/echo/v4" | ||
) | ||
|
||
func UploadMiddleware() echo.MiddlewareFunc { | ||
return func(next echo.HandlerFunc) echo.HandlerFunc { | ||
return func(c echo.Context) error { | ||
// Check if the request is multipart/form-data | ||
if c.Request().Header.Get("Content-Type") != "" && c.Request().Method == "POST" { | ||
err := c.Request().ParseMultipartForm(10 << 20) // 10 MB | ||
if err != nil { | ||
return echo.NewHTTPError(http.StatusBadRequest, "Failed to parse multipart form") | ||
} | ||
} | ||
return next(c) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.