Comments (13)
I suggest using ESLint to ensure the code style throughout the repository. And I had some docs on good REST API, I'll post them here as soon as I find them.
from unifile.
I'm actually reading this a lot: https://developer.github.com/v3/. It's a very well structured API and documentation. This could be an example.
And just to be sure, every service will now be a prototype, right?
from unifile.
I'm actually reading this a lot: https://developer.github.com/v3/. It's a very well structured API and documentation. This could be an example.
yes right!
And just to be sure, every service will now be a prototype, right?
what do you mean exactly?
from unifile.
Lately I was thinking about splitting this lib. Unifile would only take care of routes declaration and routing. In addition, services (or connector) would be dependencies, loaded at will and declared like a middleware
unifile.use(require('ftp-connector'));
This way, you only embed the connectors you want and creating a new connector doesn't imply any modification on Unifile (= don't publish a new version any time a connector changes).
And for the connector development, this mean we can ask for a clear API to implements and get rid of some internal parameters in connector function (response
, next
,...).
What do you think?
from unifile.
Wow that's a great idea, like they did with connect body-parser etc.
from unifile.
👍
from unifile.
Also, may be some of these connectors can be reused from Browser-FS. Especially the ZipFS
, WorkerFS
and FolderAdapter
types of extensions are valuable in different contexts.
from unifile.
👍 nice project!
And the idea of using nodejs API is a very good one !
from unifile.
@JbIPS I have looked at your branch and the sample here
https://github.com/JbIPS/unifile/blob/refacto-api/samples/simple-api-server.js
Concerning this part of the API (the commands)
- This is very nice 👍
- You did not take the idea of @KrishnaPG into account and prefered the "promise" version over node nodejs api, is any particular reason?
Concerning the "useConnector" part
- The name could be
use
don't you think? - and by the way, I use service more than connector but it is in fact a connector to a service. We should choose a way to call this concept and stick to it
- no json here? just the URL?
- you should move this code to the connector, so that you can know when the callback is for which connector?
from unifile.
You did not take the idea of @KrishnaPG into account and prefered the "promise" version over node nodejs api, is any particular reason?
I'm not sure what you're referring to. Callback vs Promise? If so, I hate calling 4 functions with callbacks consecutively and that's often the case with Web API.
The name could be
use
don't you think?
I thought so after I had to write it numerous time 😉. Connector or service, I don't really care but connector seemed more explicit to me at the time.
no json here? just the URL?
Don't know what you're talking about, the url must be on the wrong line.
you should move this code to the connector, so that you can know when the callback is for which connector?
I was going to but I remembered that I cannot declare route in Unifile. But maybe a dynamic function? Any other idea is welcome!
And thank you for the review, I hope will make a next version universally applauded! 😄
from unifile.
Do you think we should use the same API as fs
module? Like unifile.createReadStream()
?
from unifile.
+1 to replicate fs API
Maybe something like
var db = new require("unifile").Dropbox({...});
db.createReadStream();
from unifile.
Hi guys,
I did some work on my branch to rework the API and use all of the precious inputs in this issue.
Could you take a look at this and give me feedback to ensure we're heading in the right direction? You can find a usage example here and an implementation of the API here. Thanks!
from unifile.
Related Issues (20)
- Switch from Codacy to Coveralls
- Accents and Dropbox's writeFile HOT 8
- Batch and overwrite in dropbox
- Accented char in file name error with Dropbox HOT 2
- FTP error is wrong HOT 1
- Create unique names for folders and files in tests
- Skip auth for FS HOT 7
- Delete files and folders bug in CE HOT 3
- Question: best way to create "vhost"-like hosting HOT 1
- Unifile throws error instead of rejecting Promise HOT 2
- Typescript Support? HOT 5
- build fails? HOT 1
- strange error message HOT 5
- Change FTP client
- Breaking changes coming in basic-ftp 4.0.0
- Problems with github scopes
- [feature request][github] Support organization
- Feature request: search cloud services HOT 5
- virtual files format HOT 4
- switch to travis-ci.com HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unifile.