-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
FileSystemAdapter for saving files to the server's file system #716
Conversation
@@ -40,3 +40,7 @@ lib/ | |||
|
|||
# cache folder | |||
.cache | |||
|
|||
# Folder created by FileSystemAdapter | |||
/files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove '/'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without '/' git ignores 'src/Adapters/Files/' folder too. I added this so git ignores only the first-level 'files' folder
Thanks for the PR! Please consider adding the according tests. |
@dtsolis updated the pull request. |
Thanks for your comments! I updated the adapter. Also, regarding tests, since I am not that experienced writing tests for node it could take a while. |
Is there any special setup needed to the server for this? Or does the adapter just save the file to the specified directory? |
It just saves the file to the specified directory. This directory will be created under a 'files' folder. So, even if you want to have more than one app under the same directory, the file structure could be the following: | - files/ |
Current coverage is
|
@flovilmart Ok, so.. Not sure if i should but i did a rebase to update my branch with the latest changes on master, in order to fix some conflicts. I also i added the test on the FilesController.spec.js. |
All those commits don't seem right... You did not rebase your branch properly. you need to cleanup you rebase
if a conflict is detected, rebase will stop, and let you amend the commit/fix the conflict
Hope that helps |
@dtsolis updated the pull request. |
@dtsolis still not good at all |
b0ac55e
to
a9b2f46
Compare
@flovilmart i think now it's better |
|
||
_mkdir(path, root) { | ||
// snippet found on -> http://stackoverflow.com/a/10600228 | ||
var dirs = path.split('/'), dir = dirs.shift(), root = (root || '') + dir + '/'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please support windows too with separator
@dtsolis updated the pull request. |
Still have 12 commits here. Try updating the latest master, making a new branch, and bringing the changes in again. Close this one, then use https://github.com/ParsePlatform/parse-server/pull/716/files as a reference, and open a new PR with just 1 commit. |
@@ -53,7 +53,7 @@ if (!options.serverURL) { | |||
options.serverURL = `http://localhost:${options.port}${options.mountPath}`; | |||
} | |||
|
|||
if (!options.appId || !options.masterKey || !options.serverURL) { | |||
if (!program.appId || !program.masterKey || !program.serverURL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert those changes
Can be used while starting the parse-server