Make Meteor apps without a server?

The default meteor app is a server+client setup. Is it possible to make client-only apps, that don’t require a server connection?

I’m thinking this would be useful for certain use cases, for example deploying a Cordova application that only needs access to some Android/iOS APIs, but does not need a network.

In such a case, the client code would need to be shipped locally with the application, not served from a server.

It’d be super cool to be able to take advantage of Meteor’s build system, build plugins, and Cordova features, without requiring a server.

Is this possible with Meteor?

1 Like

As an example, at the moment I’d like to make an Android app that will connect to a nearby bluetooth device, with no network connection (other than for downloading the app from Play Store). The app would obviously need to ship with the client code.

You certainly can do this. Simply build a meteor app, and never call Meteor.call or Meteor.subscribe. You’d still technically have a server build, it would just be empty and wouldn’t require an actual server to run it.

You;d need to be careful of which packages you use, in case they assume a server connection

1 Like

@znewsham Thanks! But, if I want to deploy to Android, using the steps outlined in the docs, will it work? Or will it expect for the client code to be delivered by the server?

I’ve honestly never tried this. Should be fairly easy to test though. I don’t think it will work in dev mode (e.g., meteor android) but if you build for android, and use adb to install the apk directly to the phone, I can’t imagine why it wouldn’t work.

1 Like

Suppose I just want to make a static website with no server? It’d be nice if this was simple to do with meteor (or if it is, that it was documented).

I mean, suppose I don’t use Meteor.call, et al. Then what? I suppose I would need to extract the client bundle. Well, not that I can’t figure that out, but I’m wondering if there could be a simpler way for the dev experience.

1 Like

It should be fairly simple - have you tried “just doing it”? E.g., building as normal and installing on a device? You’ll never receive any hot code pushes of course, but beyond that it should just work

If you don’t use any server calls, it should just work. Technically, Meteor sets up a local server inside the mobile app which delivers the code to the web view. This server tries to update itself via Hot Code Push from a real server, but it should work without it. The use of a local server was introduced somewhere around Meteor 1.2 IIRC, to workaround other problems and offer a more reliable Hot Code Push Mechanism.

1 Like

I’ll have to give it a go. Maybe, it just is that easy! I’ll report back…

I’m pretty sure it works, but with a console error on startup as it tries to contact the server immediately.

I haven’t used it in a long time, but we used to use meteor-build-client to remove the server code