[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

[fbot8] Embedding the App server

We have hacked our messenger to contain S8 Smalltalk embedded and accessible from U8 tools...
Now we want to build the snapshot interactivelly and containing our frameworks required to implement the server.

Starting the demo server from U8 remote tools.

We will set the BOT server containing a clean snapshot of node8 server and will instantiate&start the BOT dynamically from a workspace using U8 remote tools connected to the S8 system.
  1. copy a clean n8.snapshot.js image from Node platform files into the node subfolder of your bot
  2. start the server with command node n8.snapshot.js

Starting the BOT (app.js) using U8 tools

We have started the S8 Smalltalk server, so we can access the system using U8 remote tools.
Take note of the server the URL to connect from U8 tools (it is shown in the console of the server you have just started).
Open a workspace connecting to your server.
Evaluate a simple expression, e.g. evaluate with showIt the expresion 3+4 and see the log in the console of the server (or open a System Browser on the same connection) to check that the server is accessible from your U8 tools.

Loading app.js as is from remote U8

Try to get the contents in app.js file in the workspace to check we can access the script provided by Facebook.
Evaluate 'app.js' fileContents with showIt in the connected workspace. It should return the contents of the script file.
Note that you caould run the app.js code in the system as-is, in case you want to setup the server from original code. To set the server with the original code, you can evaluate in a connected workspace:
Compiler new eval: 'app.js' fileContents

In our case we want to write the server in S8, so we want to implement the same behavior, but working with U8 tools.

Next: [fbot8] Implementing the App server in S8