Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions node.js/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var nj = require('nodejitsu-api'),
var client = nj.createClient({
username: 'marak',
password: 'foobar',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});

client.apps.list(function(err, result){
Expand Down Expand Up @@ -40,15 +40,15 @@ This method sets up a client for connecting to Nodejitsu's databases. Here's a m
var client = nj.createClient({
username: 'marak',
password: 'foobar',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});
```

The options object contains three required properties:

* `username`: The username for your Nodejitsu account
* `password`: The password for your Nodejitsu account
* `remoteUri`: The uri of the api host (typically [http://api.nodejitsu.com](http://api.nodejitsu.com)).
* `remoteUri`: The uri of the api host (typically [https://api.nodejitsu.com](https://api.nodejitsu.com)).


### client
Expand Down
2 changes: 1 addition & 1 deletion node.js/examples/check-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var nj = require('../lib/client'),
var client = nj.createClient({
username: 'marak',
password: 'mypassword',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});

client.users.auth(function(err, result){
Expand Down
2 changes: 1 addition & 1 deletion node.js/examples/create-api-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var nj = require('../lib/client'),
var client = nj.createClient({
username: 'marak',
password: 'foobar',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});

client.keys.create('marak/keys/test-api-key', function(err, result){
Expand Down
2 changes: 1 addition & 1 deletion node.js/examples/create-ssh-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var nj = require('../lib/client'),
var client = nj.createClient({
username: 'marak',
password: 'foobar',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});

client.keys.create('marak/keys/test-ssh-key', { "type": "ssh", "value": "foobar" }, function(err, result){
Expand Down
2 changes: 1 addition & 1 deletion node.js/examples/destroy-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var nj = require('../lib/client'),
var client = nj.createClient({
username: 'marak',
password: 'foobar',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});

client.keys.destroy('marak/keys/test-ssh-key', function(err, result){
Expand Down
2 changes: 1 addition & 1 deletion node.js/examples/get-application.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var nj = require('../lib/client'),
var client = nj.createClient({
username: 'marak',
password: 'foobar',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});


Expand Down
2 changes: 1 addition & 1 deletion node.js/examples/get-key.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var nj = require('../lib/client'),
var client = nj.createClient({
username: 'marak',
password: 'foobar',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});

client.keys.view('marak/keys/my-key', function(err, result){
Expand Down
2 changes: 1 addition & 1 deletion node.js/examples/get-logs-by-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var nj = require('../lib/client');
var client = nj.createClient({
username: 'marak',
password: 'foo',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});

client.logs.byApp('marak/hellonode', 100, function(err, result){
Expand Down
2 changes: 1 addition & 1 deletion node.js/examples/get-logs-by-user.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var nj = require('../lib/client');
var client = nj.createClient({
username: 'marak',
password: 'foo',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});

client.logs.byUser('marak', 100, function(err, result){
Expand Down
2 changes: 1 addition & 1 deletion node.js/examples/list-apps.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var nj = require('../lib/client'),
var client = nj.createClient({
username: 'marak',
password: 'foobar',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});

client.apps.list('marak', function(err, result){
Expand Down
4 changes: 2 additions & 2 deletions node.js/examples/list-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var nj = require('../lib/client'),
var client = nj.createClient({
username: 'marak',
password: 'foobar',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});

client.keys.list('marak', function(err, result){
Expand All @@ -13,4 +13,4 @@ client.keys.list('marak', function(err, result){
return;
}
console.log(JSON.stringify(result, null, 2, true));
});
});
2 changes: 1 addition & 1 deletion node.js/examples/restart-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var nj = require('../lib/client');
var client = nj.createClient({
username: 'marak',
password: 'foobar',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});

client.apps.restart('marak/hellonode', function(err, result){
Expand Down
2 changes: 1 addition & 1 deletion node.js/examples/snapshots-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var nj = require('../lib/client'),
var client = nj.createClient({
username: 'marak',
password: 'foobar',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});


Expand Down
2 changes: 1 addition & 1 deletion node.js/examples/start-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var nj = require('../lib/client');
var client = nj.createClient({
username: 'marak',
password: 'foobar',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});

client.apps.start('marak/hellonode', function(err, result){
Expand Down
2 changes: 1 addition & 1 deletion node.js/examples/stop-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ var nj = require('../lib/client');
var client = nj.createClient({
username: 'marak',
password: 'foobar',
remoteUri: 'http://api.nodejitsu.com'
remoteUri: 'https://api.nodejitsu.com'
});

client.apps.stop('marak/hellonode', function(err, result){
Expand Down
22 changes: 11 additions & 11 deletions node.js/test/commands/apps-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var vows = require('vows'),
vows.describe('apps').addBatch(makeApiCall(
'apps list',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.get('/apps/tester')
.reply(200, {
apps: []
Expand All @@ -15,7 +15,7 @@ vows.describe('apps').addBatch(makeApiCall(
)).addBatch(makeApiCall(
'apps list myUser',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.get('/apps/myUser')
.reply(200, {
apps: []
Expand All @@ -25,14 +25,14 @@ vows.describe('apps').addBatch(makeApiCall(
'apps create',
{ name: 'myApp' },
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.post('/apps/tester/myApp', { name: 'myApp' })
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'apps view myApp',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.get('/apps/tester/myApp')
.reply(200, {
app: {}
Expand All @@ -41,7 +41,7 @@ vows.describe('apps').addBatch(makeApiCall(
)).addBatch(makeApiCall(
'apps view myUser/myApp',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.get('/apps/myUser/myApp')
.reply(200, {
app: {}
Expand All @@ -51,14 +51,14 @@ vows.describe('apps').addBatch(makeApiCall(
'apps update myUser/myApp',
{ foo: 'bar'},
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.put('/apps/myUser/myApp', { foo: 'bar' })
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'apps destroy myUser/myApp',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.destroy('/apps/myUser/myApp')
.reply(200, {
apps: []
Expand All @@ -67,29 +67,29 @@ vows.describe('apps').addBatch(makeApiCall(
)).addBatch(makeApiCall(
'apps start myApp',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.post('/apps/tester/myApp/start', {})
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'apps restart myApp',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.post('/apps/tester/myApp/restart', {})
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'apps stop myApp',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.post('/apps/tester/myApp/stop', {})
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'apps available',
{ name: 'myApp' },
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.post('/apps/tester/myApp/available', { name: 'myApp'})
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
Expand Down
8 changes: 4 additions & 4 deletions node.js/test/commands/databases-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ var vows = require('vows'),
vows.describe('databases').addBatch(makeApiCall(
'databases create couch chair',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.post('/databases/tester/chair', { type: 'couch'})
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'databases get chair',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.get('/databases/tester/chair')
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'databases list',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.get('/databases/tester')
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'databases destroy chair',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.delete('/databases/tester/chair', {})
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
Expand Down
4 changes: 2 additions & 2 deletions node.js/test/commands/logs-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var vows = require('vows'),
vows.describe('logs').addBatch(makeApiCall(
'logs byApp myApp 50',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.post('/logs/tester/myApp', {
from: "NOW-1DAY",
until: "NOW",
Expand All @@ -17,7 +17,7 @@ vows.describe('logs').addBatch(makeApiCall(
)).addBatch(makeApiCall(
'logs byUser myUser 50',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.post('/logs/myUser', {
from: "NOW-1DAY",
until: "NOW",
Expand Down
8 changes: 4 additions & 4 deletions node.js/test/commands/snapshots-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ var vows = require('vows'),
vows.describe('snapshots').addBatch(makeApiCall(
'snapshots list myApp',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.get('/apps/tester/myApp/snapshots')
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'snapshots destroy myApp v0.0.0',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.delete('/apps/tester/myApp/snapshots/v0.0.0', {})
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'snapshots activate myApp v0.0.0',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.post('/apps/tester/myApp/snapshots/v0.0.0/activate', {})
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
Expand All @@ -31,7 +31,7 @@ vows.describe('snapshots').addBatch(makeApiCall(
path.join(__dirname, '../fixtures/snapshot.tgz')
].join(' '),
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.post('/apps/tester/myApp/snapshots/v0.0.0', 'This is only a test.\n')
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
Expand Down
12 changes: 6 additions & 6 deletions node.js/test/commands/users-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,44 @@ vows.describe('users').addBatch(makeApiCall(
'users create',
{ username: 'adam' },
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.post('/users/adam', { username: 'adam' })
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'users available eve',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.get('/users/eve/available')
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'users view abraham',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.get('/users/abraham')
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'users confirm',
{ username: 'noah' },
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.post('/users/noah/confirm', { username: 'noah' })
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'users forgot job',
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.post('/users/job/forgot', {})
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
)).addBatch(makeApiCall(
'users update moses',
{ prophet: true },
function setup () {
nock('http://api.mockjitsu.com')
nock('https://api.mockjitsu.com')
.put('/users/moses', { prophet: true})
.reply(200, {}, { 'x-powered-by': 'Nodejitsu' })
}
Expand Down
2 changes: 1 addition & 1 deletion node.js/test/macros.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var createClient = require('../lib/client').createClient,
client = createClient({
username: 'tester',
password: 'password',
remoteUri: 'http://api.mockjitsu.com'
remoteUri: 'https://api.mockjitsu.com'
}),
assert = require('assert');

Expand Down