Vibers review: fix build failures (missing middleware + .env.example)#2
Open
marsiandeployer wants to merge 1 commit intoMethasMP:mainfrom
Open
Vibers review: fix build failures (missing middleware + .env.example)#2marsiandeployer wants to merge 1 commit intoMethasMP:mainfrom
marsiandeployer wants to merge 1 commit intoMethasMP:mainfrom
Conversation
…erns - Add Recovery(), CORSMiddleware(), SecurityHeadersMiddleware() — declared in main.go but files were missing, causing build failure - Add frontend/.env.example so new devs know what variables are required - Fix back-end/.gitignore: binary names (api, verify, worker) were matching the cmd/api/ directory and hiding source files from git; changed to /api etc. How to test: cd back-end && go build ./... # should succeed with exit 0 cd frontend && flutter build web # requires .env (copy from .env.example)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was broken
This PR fixes issues that prevented the project from building at all.
1. Go backend: 3 missing middleware files
main.gocallsmiddleware.Recovery(),middleware.CORSMiddleware(), andmiddleware.SecurityHeadersMiddleware()— but none of these files existed. The backend cannot compile without them.Added minimal correct implementations:
recovery.go— panic recovery → 500 responsecors.go— CORS headers, origin fromCORS_ORIGINenv var (defaults tohttps://paycif.com)security_headers.go— standard security headers (X-Frame-Options, X-Content-Type-Options, etc.)2. Flutter frontend: missing
.envassetpubspec.yamldeclares.envas an asset, but the file is gitignored and not in the repo. Flutter build fails with:Added
frontend/.env.example— copy it to.envbefore building:cp frontend/.env.example frontend/.env # fill in real values flutter build web3.
.gitignorewas hiding source filesback-end/.gitignorehad bare names likeapi,verify,workermeant to ignore compiled binaries. These patterns also matched thecmd/api/source directory, making those files invisible to git.Changed to
/api,/verify,/worker(root-relative patterns).How to verify
Both should succeed after this PR.
Reviewed by @marsiandeployer via Vibers