-
Notifications
You must be signed in to change notification settings - Fork 123
Startup JSON
temas edited this page Jun 14, 2011
·
1 revision
When a service starts it is sent a chunk of JSON for some of the Locker state and service options. It must then reply with a similar piece of JSON before it will receive anything.
Here is a startup piece of JSON:
{
port:18043,
sourceDirectory:"Connectors/SimpleJournal",
processOptions:{},
workingDiretory:"Me/simplejournal",
lockerUrl:"http://localhost:8042"
}
The properties are
- port - A suggested port for the service to listen on. It's not mandatory that this port be used.
- sourceDirectory - The directory that the service code resides in. Useful to keep common static data in it then reference back to it.
- processOptions - These are options that were put in the service manifest, (the .app, .connector, or .collection file). They are a straight copy of that field. This way you can pass any other options.
- workingDirectory - This is the Me directory that this instance of the service was installed to. Generally you will want to chdir to this directory. This is the only disk space that should be written to by the service.
- lockerUrl - The base URL the Locker itself is running at. This can be used to derive almost any needed system URL and to make core API calls.
Once the service is running and ready to accept connections it needs to reply on stdout with the minimum of the port that it is running on.
{port:18043}
You're now alive and rolling!