Skip to content

Commit 16e78e4

Browse files
Step 2 - Install Ably
1 parent b2c5b90 commit 16e78e4

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "ably-tutorials",
3+
"author": "Ably <hello@ably.io>",
4+
"description": "Node.js Reactor Queue and Wolfram Alpha tutorial",
5+
"repository": "https://github.com/ably/tutorials",
6+
"license": "Apache-2.0",
7+
"engines": {
8+
"node": ">=0.10"
9+
},
10+
"scripts": {
11+
"start": "node ./server.js"
12+
},
13+
"dependencies": {
14+
"ably": ">=0.9.0-beta"
15+
}
16+
}

server.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const Ably = require('ably');
2+
3+
const ApiKey = 'INSERT-YOUR-API-KEY-HERE'; /* Add your API key here */
4+
if (ApiKey.indexOf('INSERT') === 0) { throw('Cannot run without an API key. Add your key to server.js'); }
5+
6+
/* Instance the Ably library */
7+
const rest = new Ably.Rest({ key: ApiKey });

0 commit comments

Comments
 (0)