Golang Prisma Postgresql Railway
- post
go run main.go
We do this step every time we edit the schema
go run github.com/steebchen/prisma-client-go generate dev
This command will create two file, one for preview other will implement that migration
go run github.com/steebchen/prisma-client-go migrate dev --preview-feature --create-only
This command will direct implement the migration without preview the sql
go run github.com/steebchen/prisma-client-go migrate dev
tree -I '.github|.trunk|prisma'
.
βββ README.md
βββ TODO.md
βββ api
β βββ v1
β β βββ account_routes.go
β β βββ address_routes.go
β β βββ category_routes.go
β β βββ listing_routes.go
β β βββ media_routes.go
β β βββ phone_routes.go
β β βββ post_routes.go
β β βββ publication_media_routes.go
β β βββ publication_routes.go
β β βββ role_routes.go
β β βββ user_media_routes.go
β β βββ user_routes.go
β βββ v2
βββ common
β βββ web_reponse.go
βββ config
β βββ database.go
βββ domain
β βββ account
β β βββ controller
β β β βββ account_controller.go
β β βββ dto
β β β βββ account_create_dto.go
β β β βββ account_response_dto.go
β β β βββ account_update_dto.go
β β βββ model
β β β βββ account.go
β β βββ repository
β β β βββ account_repository.go
β β β βββ account_repository_impl.go
β β βββ service
β β βββ account_service.go
β β βββ account_service_impl.go
β βββ post
β β βββ controller
β β β βββ post_controller.go
β β βββ dto
β β β βββ post_create.go
β β β βββ post_respose.go
β β β βββ post_update_request.go
β β βββ model
β β β βββ post.go
β β βββ repository
β β β βββ post_repository.go
β β β βββ post_repository_impl.go
β β βββ service
β β βββ post_service.go
β β βββ post_service_impl.go
βββ go-arepas
βββ go.mod
βββ go.sum
βββ helper
β βββ error.go
β βββ json.go
βββ main.go
βββ router
β βββ router.go
βββ thunder-collection_go-prisma.json
βββ trunk
In your .env file or environment settings, define the allowed origins for different environments.
In dev
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://localhost:4322,http://localhost:8080
CORS_ALLOWED_METHODS=GET,POST,PUT,DELETE,OPTIONS
CORS_ALLOWED_HEADERS=Content-Type,Authorization
In production, you would set the CORS_ALLOWED_ORIGINS to your actual domain(s):
CORS_ALLOWED_ORIGINS=https://your-astro-client.com,https://your-android-client.com,https://your-ios-client.com