You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-07-28 17:02:01 +03:00
Redo build process for browsers and node. Update examples.
We now rely on browserify for building browser-specific versions of the JS SDK. This can be initiated by running 'npm run build-js'. Node versions are unaffected.
This commit is contained in:
@ -1,11 +1,15 @@
|
||||
"use strict";
|
||||
console.log("Loading node sdk");
|
||||
|
||||
var matrix = require("./lib/matrix");
|
||||
var matrix = require("matrix-js-sdk");
|
||||
matrix.request(require("request"));
|
||||
|
||||
var client = matrix.createClient("http://matrix.org");
|
||||
client.publicRooms(function (err, data) {
|
||||
console.log("data %s", JSON.stringify(data));
|
||||
console.error("err %s", JSON.stringify(err));
|
||||
if (err) {
|
||||
console.error("Error: %s", JSON.stringify(err));
|
||||
return;
|
||||
}
|
||||
console.log("data %s", JSON.stringify(data).substring(0, 200));
|
||||
console.log("Congratulations! The SDK is working in Node.js!");
|
||||
});
|
||||
|
Reference in New Issue
Block a user