appjet.jar

All the software you need to host AppJet apps.

Download

Requirements

  • Java 1.6+

Mac OS X: You will need to update to the latest Java (requires OS X 10.5) and then configure Java Preferences according to these instructions.

Windows or Linux: You can get Java 1.6 from Sun.

Installation

Just put the jar file somewhere accessible from the command prompt.

Running an App

$ java -jar appjet.jar myapp.js

That's it! myapp.js should contain the same JavaScript code that you would use for an app hosted on appjet.com.

Complete Example

On a unix system with wget and Java installed:

$ wget appjet.com/jar/appjet-latest.jar -O appjet.jar
$ wget txt.source.hello-world.appjet.net -O main.js
$ java -jar appjet.jar

Note that when you don't specify a file to run, it looks for "main.js"

Configuration

There are many configuration options. To see them all, run:

$ java -jar appjet.jar --help

Alternatively, you can create a properties file "appjet.properties" and point to it with --configFile=/path/to/appjet.properties.

For example, to serve the app on port 9000, you can either pass "--port=9000" as a command-line argument, or put "port=9000" as a line in your appjet.properties file.

Here is an example appjet.properties file:

port=80
appHome=/var/myAwesomeApp/src/
appjetHome=/appjet/

And here are all the available configuration options.

PropertyDescriptionDefault
port Port on which to serve the main app. 8080
dashboardPort Port on which to serve the "dashboard", which includes a shell and a debug log. (none)
previewPort Port on which to serve the app in "preview" mode. (none)
appHome Base directory to look for app's code files, such as main.js ./
appjetHome Directory to use for storing appjet support files, such as cron database, storage database, logs, etc. This directory will be created if it does not exist and must be writeable by appjet.jar. ./appjet
maxStorageBytes Quota for storage database. 104857600 (100MB)
ajstdlibHome Optional alternative directory to load built-in libraries from. Used by AppJet platform hackers to develop and debug built-in libraries. (use built-in libraries)
devMode Enables "developer mode". (Not for general use).  

Other Features

Database storage: Just like on appjet.com, you can import "storage" to store data persistently. Naturally, the database is persisted on disk between restarts of the server. You can also customize the storage quota with the --maxStorageBytes option.

Dashboard: If you specify a --dashboardPort option, appjet.jar will additionally listen on that port and serve an administrator's dashboard. (Be careful about making this port public to your users!)

Shell: You can access the command shell of the running app on the dashboard page.

Preview mode: Some AppJet apps rely on "preview mode" for certain operations. The configuration option --previewPort can be used to specify a port to serve the app in preview mode.

Editing code: appjet.jar will automatically notice changes to your javascript files, so you do not need to restart the server between file edits.

Importing libraries: When you call import("lib-foo"), appjet.jar will look for a corresponding file in the appHome directory named "lib-foo.js". The appHome directory defaults to the working directory.

Logs: Apache-esque logs are stored in [appjetHome]/log/appserver/engine.access.[date].request.log.

License & Source Code

Disclaimer: The appjet.jar software is provided "as is", and you use it at your own risk. AppJet Inc. is not responsible for anything bad that may happen.

Known Issues

  • The source link in the generated footer is broken.

Feedback

Please send feedback to feedback@a**j**.com or use this quick feedback form.

ChangeLog

  • 1.0.3: Unicode support in source files.
  • 1.0.2: Fixed an error in handling line endings.
  • 1.0.1: Experimental support for Java 1.5 (not officially supported).
  • 1.0: Initial release.



© Copyright 2007-2009 AppJet Inc.