-
Notifications
You must be signed in to change notification settings - Fork 33
Deployment
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.
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.
Write me.
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.
Deploying a FOAM app to Google Compute Engine is straightforward.
- Get an account on Google Cloud Platform.
- Start a VM instance; any size should do.
- Install Node.js, eg.
sudo apt-get install nodejs - Clone FOAM:
git clone https://github.com/foam-framework/foam.git - Enable HTTP(S) serving in the GCE console.
If you want to work with the Cloud Datastore, you'll need to do the following:
- Enable the Cloud Datastore API from the APIs page of the Cloud Developer Console.
- Create an instance of the
Datastoremodel, providing the name of your Cloud Console project as the Datastore name. - Add the
Datastoreto your context. - Create one or more
DatastoreDAOs which have thatDatastorein 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.