From Ape Wiki
Contents |
[edit] How to write an application with APE
[edit] Server Side
There are different ways to write an application with APE, depending on your needs :
- Creating/using an APE module
- Using inlinepush module to push data from your php/rails/python/... application to APE
- Using APE as a proxy to connect to a third party server
- Mixing all these methods to create a powerful application
[edit] APE server side module
The APE module is the fastest, most modular and powerful way to exchange data between all users. With a APE module you can :
- Push data to a client
- Push data to a channel
- Set property to user (for example user nickname)
- Set property on channel (for example save last sent message on the channel)
- Get information about users connected to APE
- Get data from a MySQL server
- Create a socket
- Do many other things
APE modules can be written in JavaScript, C or C++
For more information check the APE Tutorial and How to build server side javascript module
[edit] Inlinepush
Inlinepush allows you to push data from your application (php/ruby/python/java/...) to the APE server. Right now you can only send data to one single channel. The libape-controller is the easiest way to push data from external applicatiosn to APE.
Check the demo "controller" in the JSF github repository or on the wiki
[edit] APE as a proxy
You can use APE as a proxy. A client asks APE to connect to an external server. Then APE forwards data from this server to the client and vice-versa. An good example is the TCPSocket demo.
This feature allow you to connect in javascript to any server / port / protocol you wish in javascript! See : TCPSocket
[edit] Client side
On the client side, you just have to intercept event from APE server. To make your life easier we provide you with a simple way to execute a function when you receive something. Check the wiki tutorial and the shoutbox demo for a real world example.
[edit] External links
[edit] Libape_controller examples
EsenAPE – send and receive SMS in real time (0.9)
Very basic example showing how to use libape_controller controller (0.9)
APE overview (1.0)


