问题
I'm planning to write some native applciation with web application method. I've searched quite some pages and was planning to use node.js + angular + something... but now would like to try Meteor since I've already used MongoDb and I don't want to learn too many frameworks "frontend" or "backend". Simple and easy to learn is core to me.
Few questions: Is MeteorJS fit for desktop application? Or, Could MeteorJS app be packaged with node-webkit? Any example to follow?
I would also like to get suggestions if someone uses Python/C++ extension in backend for data manipulation or what ever. Is MeteorJS good for such application?
Thanks,
回答1:
Meteor and node-webkit make for an incredibly powerful combination, because they allow you to:
- rapidly develop a desktop app with meteor/js/html/css goodness
- dynamically update your app after shipping it to the user
- fully use the node API on a user's machine
You could probably use these two technologies in a few ways including:
- a fairly static app which talks to a remote server via DDP
- a completely dynamic app which receives all of its code every time it starts (see below)
- a self-hosted meteor server on the user's machine (I have not tried this approach)
Here is an example package.json which demonstrates how to load your app completely dynamically (just like a web page) from myapp.example.com:
{
"name": "myApp",
"node-remote": "myapp.example.com",
"main": "https://myapp.example.com/",
"version": "0.0.1",
"window": {
"icon": "logo.png",
"toolbar": false,
"frame": true,
"resizable": false,
"position": "center",
"width": 500,
"height": 500
}
}
There are a couple of things I'll caution you about:
While the application code can be updated at any time, if you require node modules or other libraries, you will need to package those ahead of time along with the
nwbinary. For example, if you want your users to be able to view h264 video, you'll need to ship with the necessary libraries.If you load your application code from the internet, be aware of the potential dangers. If someone were to gain control of your DNS or your servers, all of your users could have a really bad day. The proper way to deal with this is to sign your application code before it can be loaded by node-webkit but that's beyond the scope of this answer.
回答2:
GitHub (itself) makes Electron: http://electron.atom.io/, which like node-webkit allows you to make desktop applications with node.js and a Chromium-based browser.
I think that there's a bit more separation of the node.js and browser code in Electron than there is with node-webkit, which is probably a good thing.
Here's a Meteor package to help you integrate Meteor into an Electron-based app. https://atmospherejs.com/jrudio/electron
I haven't tried or tested this solution, but it should give you a good start.
来源:https://stackoverflow.com/questions/22318856/basic-questions-for-meteorjs