Skip to content

Commit fd875fb

Browse files
author
Hovhannes Babayan
committed
added https support and more tests
1 parent 680c3d0 commit fd875fb

20 files changed

Lines changed: 132 additions & 68 deletions

dist/attask.min.js

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/browser/login.html

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@
1111
<script src="/dist/attask.min.js"></script>
1212
<script>
1313
function doLogin() {
14-
var host = document.getElementById('hostname').value;
15-
var port = document.getElementById('port').value;
14+
var url = document.getElementById('url').value;
1615
var username = document.getElementById('username').value;
1716
var password = document.getElementById('password').value;
1817

19-
var instance = new window.AtTask.Api({hostname: host, version: '5.0', port: port});
18+
var instance = new window.AtTask.Api({url: url, version: '5.0'});
2019
instance.login(username, password).then(function(data){
2120
console.log(data)
2221
}, console.error);
@@ -27,12 +26,8 @@
2726
<div class="container">
2827
<div>
2928
<div class="form-group">
30-
<label for="hostname">Hostname</label>
31-
<input type="text" class="form-control" id="hostname" value="localhost" placeholder="Hostname to use for connection to AtTask">
32-
</div>
33-
<div class="form-group">
34-
<label for="port">Port</label>
35-
<input type="text" class="form-control" id="port" value="8080" placeholder="Port to use for connection to AtTask">
29+
<label for="url">Url</label>
30+
<input type="text" class="form-control" id="url" value="http://localhost:8080" placeholder="Url to use for connection to AtTask">
3631
</div>
3732

3833
<div class="form-group">

examples/node/create-new-project.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ var ApiFactory = require('./../../').ApiFactory;
66
var util = require('util');
77

88
var instance = ApiFactory.getInstance({
9-
hostname: 'localhost',
10-
version: '5.0',
11-
port: 8080
9+
url: 'http://localhost:8080',
10+
version: '5.0'
1211
});
1312

1413
util.print('Logs in, then creates a new project with name "API Project"\n');

examples/node/get-metadata.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ var ApiFactory = require('./../../').ApiFactory;
66
var util = require('util');
77

88
var instance = ApiFactory.getInstance({
9-
hostname: 'localhost',
10-
version: '5.0',
11-
port: 8080
9+
url: 'http://localhost:8080',
10+
version: '5.0'
1211
});
1312

1413
util.print('Logs in, returns metadata about available API resources\n');

examples/node/get-multiple-tasks.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ var ApiFactory = require('./../../').ApiFactory;
66
var util = require('util');
77

88
var instance = ApiFactory.getInstance({
9-
hostname: 'localhost',
10-
version: '5.0',
11-
port: 8080
9+
url: 'http://localhost:8080',
10+
version: '5.0'
1211
});
1312

1413
util.print('Logs in, queries details of multiple tasks\n');

examples/node/get-project-details.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ var ApiFactory = require('./../../').ApiFactory;
66
var util = require('util');
77

88
var instance = ApiFactory.getInstance({
9-
hostname: 'localhost',
10-
version: '5.0',
11-
port: 8080
9+
url: 'http://localhost:8080',
10+
version: '5.0'
1211
});
1312

1413
util.print('Logs in, queries project and project owner details by project id\n');

examples/node/get-task-metadata.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ var ApiFactory = require('./../../').ApiFactory;
66
var util = require('util');
77

88
var instance = ApiFactory.getInstance({
9-
hostname: 'localhost',
10-
version: '5.0',
11-
port: 8080
9+
url: 'http://localhost:8080',
10+
version: '5.0'
1211
});
1312

1413
util.print('Logs in, queries metadata for the task object (objCode: TASK)\n');

examples/node/get-user-count.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ var ApiConstants = require('./../../').ApiConstants;
77
var util = require('util');
88

99
var instance = ApiFactory.getInstance({
10-
hostname: 'localhost',
11-
version: '5.0',
12-
port: 8080
10+
url: 'http://localhost:8080',
11+
version: '5.0'
1312
});
1413

1514
util.print('Logs in, returns number of active users\n');

examples/node/login.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ var ApiFactory = require('./../../').ApiFactory;
66
var util = require('util');
77

88
var instance = ApiFactory.getInstance({
9-
hostname: 'localhost',
10-
version: '5.0',
11-
port: 8080
9+
url: 'http://localhost:8080',
10+
version: '5.0'
1211
});
1312

1413
util.print('Logs in\n');

examples/node/logout.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ var ApiFactory = require('./../../').ApiFactory;
66
var util = require('util');
77

88
var instance = ApiFactory.getInstance({
9-
hostname: 'localhost',
10-
version: '5.0',
11-
port: 8080
9+
url: 'http://localhost:8080',
10+
version: '5.0'
1211
});
1312

1413
util.print('Logs in and logs out\n');

0 commit comments

Comments
 (0)