Closed GurinderRawala closed 1 month ago
The changes introduced in this pull request consist of three main modifications. The README.md
file has been updated to include a new instruction for building the server. The src/api/routes/files.js
file has enhancements in logging for successful file uploads and improved error handling for file deletions. Lastly, the CORS configuration in src/api/server.js
has been altered to allow requests from any origin by using a wildcard instead of a specific URL.
File Path | Change Summary |
---|---|
README.md | Added a new step in the "Get Started" section for building the server with the command npm run build . |
src/api/routes/files.js | Added a logging statement after successful file uploads and improved error handling in the delete file route. |
src/api/server.js | Modified CORS configuration to allow requests from any origin by changing origin to '*' . |
sequenceDiagram
participant User
participant Server
participant Database
User->>Server: Upload File
Server->>Database: Save File Info
Database-->>Server: File Info Saved
Server->>User: File Uploaded Successfully
Server->>Server: Log "file info uploaded successfully"
sequenceDiagram
participant User
participant Server
participant Database
User->>Server: Delete File
Server->>Database: Find File
alt File Found
Database-->>Server: File Found
Server->>Database: Delete File
Database-->>Server: File Deleted
Server->>User: File Deleted Successfully
else File Not Found
Database-->>Server: Error Finding File
Server->>Server: Log "Error occurred while attempting to find the data"
Server->>User: Error Deleting File
end
🐇 In the garden, where bunnies play,
A new step added, hip-hip-hooray!
Build the server, oh what a delight,
With logs and errors shining bright!
CORS now welcomes all with glee,
Hopping along, come join us, whee!
🌼
Summary by CodeRabbit
New Features
npm run build
.Bug Fixes
Chores