-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated readme with requirements, docs
- Loading branch information
Showing
3 changed files
with
82 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,29 @@ | ||
|
||
/* TODO doc */ | ||
/** | ||
* NodeJS does not support CommonJS Asynchronous Module Definitions, but the | ||
* operation engine API is built using AMDs. In order to use the OT API with | ||
* NodeJS, we must use the requirejs module. | ||
* | ||
* We set `define' in the global namespace to requirejs's define function so | ||
* that the OT API code can use it. | ||
* | ||
*/ | ||
var requirejs = require("requirejs"); | ||
var define = requirejs.define; | ||
|
||
requirejs.config({ | ||
nodeRequire : require, | ||
baseUrl : "/Users/ibmcoop/dev/jsoe", | ||
baseUrl : "../", | ||
paths : { | ||
"coweb/jsoe" : "/Users/ibmcoop/dev/jsoe" | ||
"coweb/jsoe" : "./" | ||
} | ||
}); | ||
|
||
requirejs([ | ||
"OTEngine" | ||
], function(OTEngine) { | ||
var ot = new OTEngine(0); | ||
console.log(ot.createOp("topic", 1,2,3)); | ||
/* If we get here, then everything worked correctly. */ | ||
}); | ||
|