Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add createFile middleware #130

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

RRK1000
Copy link
Collaborator

@RRK1000 RRK1000 commented Oct 11, 2019

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
res.status(500).send({ error: err });
}
console.log("File Created");
res.status(200).send({ success: true, message: "File Created." });
Copy link
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
Copy link
Collaborator Author

RRK1000 commented Oct 20, 2019

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