Skip to content

Add createFile middleware - #130

Open
RRK1000 wants to merge 2 commits into
pes-alcoding-club:developmentfrom
RRK1000:development
Open

RRK1000 wants to merge 2 commits into
pes-alcoding-club:developmentfrom
RRK1000:development

Conversation

@RRK1000

@RRK1000 RRK1000 commented Oct 11, 2019

Copy link
Copy Markdown
Collaborator

Creates a text file using the fs module. Text file contents are to be sent in the request body(req.body.text).

@RRK1000
RRK1000 requested a review from aniketnk October 11, 2019 13:54
Comment thread server/middleware/fileStorage.js Outdated
res.status(500).send({ error: err });
}
console.log("File Created");
res.status(200).send({ success: true, message: "File Created." });

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of returning res, throw an error, or return an appropriate message. Also, please add an example of how to use this util.

@RRK1000

RRK1000 commented Oct 20, 2019

Copy link
Copy Markdown
Collaborator Author

Usage Example
image

The utilities return the object id of the uploaded file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants