Skip to content
Lomilar edited this page Oct 10, 2014 · 4 revisions

Prerequisites:

(Debian/Ubuntu)

#Install Tomcat
sudo apt-get install tomcat7
#Initialize LEVR Directory in Tomcat
mkdir /var/lib/tomcat7/etc
chown tomcat7:tomcat7 /var/lib/tomcat7/etc
#Stop Tomcat
service tomcat7 stop
#Download LEVR
cd /var/lib/tomcat7/webapps
wget http://build.eduworks.com/dist/levr/levr.war #Initialize your first RS2
touch /var/lib/tomcat7/etc/myFirst.rs2
#Start Tomcat
service tomcat7 start
#Tail the Log (use fg and ctrl+c to stop)
tail -F /var/lib/tomcat7/logs/catalina.out &

(Redhat/Amazon)

#Install Tomcat
yum install tomcat7
#Initialize LEVR Directory in Tomcat
mkdir /usr/share/tomcat7/etc
chown tomcat:tomcat /usr/share/tomcat7/etc
#Stop Tomcat
service tomcat7 stop
#Download LEVR
cd /usr/share/tomcat7/webapps
wget http://build.eduworks.com/dist/levr/levr.war
#Initialize your first RS2
touch /usr/share/tomcat7/etc/myFirst.rs2
#Start Tomcat
service tomcat7 start
#Tail the Log (use fg and ctrl+c to stop)
tail -F /usr/share/tomcat7/logs/catalina.out &

Now to start writing some code!

Open up /etc/myFirst.rs2 in your favorite text editor.

//This is a comment
helloWorld=#object(a="Hello World").displayJson();
/helloWorld=helloWorld;

Now to test it.

Navigate to:

http://<server ip>:8080/levr/api/custom/helloWorld

You should see a JSON object return as such:

{
obj: {
a: "Hello World"
}
}

And you're off to the races!

Now lets get some API.

resolvers=#reflectionManifest().displayJson(_collapse="true");
/levrage/resolvers=resolvers;

Clone this wiki locally