Skip to content

Deployment

Braden Shepherdson edited this page Jan 6, 2015 · 1 revision

Deploying FOAM Apps

Web Apps

FOAM is ultimately a set of static Javascript files: serve them with any web server and put them in a <script> tag.

Consider using the Grunt script to build single concatenated files.

Future Plans

We hope to build tools in the future that will take your app and examine which models it requires, recursively, and build a single JS file that includes exactly those models you need.

Chrome Apps

Write me.

Server Side

FOAM runs in Node.js for implementing servers. There are server-side DAOs: for JSON and XML files, for MongoDB, and for Google Cloud Datastore.

Google Compute Engine

Deploying a FOAM app to Google Compute Engine is straightforward.

  1. Get an account on Google Cloud Platform.
  2. Start a VM instance; any size should do.
  3. Install Node.js, eg. sudo apt-get install nodejs
  4. Clone FOAM: git clone https://github.com/foam-framework/foam.git
  5. Enable HTTP(S) serving in the GCE console.

Google Cloud Datastore

If you want to work with the Cloud Datastore, you'll need to do the following:

  1. Enable the Cloud Datastore API from the APIs page of the Cloud Developer Console.
  2. Create an instance of the Datastore model, providing the name of your Cloud Console project as the Datastore name.
  3. Add the Datastore to your context.
  4. Create one or more DatastoreDAOs which have that Datastore in their context.

The Cloud Datastore API for JSON/Node is beta, and there are bugs in it. The FOAM support for it is also beta. The basics work, but several things do not. See the TODOs in the code.

Note that you do not need to run on Compute Engine to access Cloud Datastore, but you do need a server that has a private key. Google's documentation explains how to set that up.

Clone this wiki locally