Giter Site home page Giter Site logo

googlearchive / acre Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 1.0 20.23 MB

Automatically exported from code.google.com/p/acre

License: Apache License 2.0

Shell 1.35% Python 6.05% Perl 0.25% Java 32.21% JavaScript 50.51% CSS 1.70% Makefile 0.43% HTML 7.50%

acre's Introduction

                
                   Acre (A Crash of Rhinos Evaluating)
                   -----------------------------------


Acre is a server-side Javascript platform for implementing web applications
easily.  It was designed to facilitate the development of applications that
make use of the data provided by Freebase.com, though it is a capable platform
for generic web application development. Applications are generally implemented
using the Acre templating language, which is a variation of Mjt
(http://mjtemplate.org). It's also possible to implement applications directly
in Javascript, which is preferable for APIs that return JSON results.

Traditionally, Acre stores the meta-data and source required to find and run
applications using the APIs provided by freebase.com.  The retrieval mechanism
for discovering source and meta data is pluggable, and thus easily extensible.
This release includes a method that uses the local file system to find and run
applications, as well as the more traditional freebase.com implementation.


Building Acre
-------------

Acre requires you to have a Java Developer's Kit installed (version 5 or greater)
and Apache Ant. (basically, 'java', 'javac' and 'ant' need to be present in your path).
All the libraries that Acre requires to build and to run are already shipped with it.

To build, simply type

  ./acre build


Running Acre
------------

To run acre, simply type:

  ./acre run

and then look at:

  http://127.0.0.1:8115/acre/status in your browser.

If everything looks alright, congratulations, you have Acre running! 

By default, Acre gets data and source code from sandbox-freebase.com. 
If you want it to get data and source code from the main freebase.com site 
run it like this:

  ./acre -c freebase run


Developing Acre apps residing on your local disk
------------------------------------------------

Acre will look for your local acre apps in the 'webapp/WEB-INF/scripts' directory.  
Here's a simple example:

Your app is called:      foo
Put the files in:        webapp/WEB-INF/scripts/foo/
Point your browser at:   http://foo.dev.acre.localhost:8115/

Acre by default is configured to expect your apps to be responding to *.dev.acre.localhost:8115 domains.  
To make this work, you will need to configure a hostname for each app you're
working on to tell your computer it should route the requests to those domains to Acre.
The simplest way to do this is by adding the following to your /etc/hosts file:

  127.0.0.1   foo.dev.acre.localhost

(unfortunately, you can't use wildcards in /etc/hosts so you have to add a new line for 
each app you want your local acre to serve)

I you want to use a different base URL (for example, once you deploy Acre on your own server), 
update 'ACRE_HOST_BASE' in your 'config/project.local.conf' file, and restart Acre.

You can use subdirectories for different versions of your apps, staging, etc.
The directory structure is the same as the namespace path in freebase.com, so
if you want acre to serve:

  http://foo.bar.dev.acre.localhost:8115/index

you would create the directory 'webapp/WEB-INF/scripts/bar/foo' and place a
file named 'index.<ext>' in it. Acre uses the extension to determine what
mechanism to use to run the file. By default Acre will serve the file as raw
text unless certain extensions are used:

  .mjt will treat the file as an Acre template
  .sjs will treat the file as a server-side Javascript file
  .mql will treat the file as a MQL Query
  .{png, jpg, gif} will serve the file as binary with the appropriate mime-type


Example apps
------------

Some simple example applications are included in this distribution.

Example 1: Hello World

The files can be found at:
  webapp/WEB-INF/scripts/examples/helloworld

Add this line to your /etc/hosts:
  127.0.0.1 helloworld.examples.dev.acre.localhost

Point your browser at:
  http://helloworld.examples.dev.acre.localhost:8115/


			                     - o -


Thank you for your interest.


                                          The Acre Development Team

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.