-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserver.js
31 lines (25 loc) · 1.21 KB
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* Created by dbeckerfl on 10/14/17.
*/
var http = require("http");
var { JIRA } = require('./src/JIRA');
//Create HTTP server and listen on port 8000 for requests
http.createServer(function (request, response) {
// Set the response HTTP header with HTTP status and Content type
response.writeHead(200, {'Content-Type': 'text/plain'});
var jiraSession = new JIRA("admin", "hackgt2017");
response.write(jiraSession.queryAll("admin"));
//response.write(jiraSession.doTransition("10005"));
response.write(jiraSession.updateSummary("10005", "Summary test 1"));
response.write(jiraSession.updateDescription("10005", "Description test 1"));
response.write(jiraSession.assign("10005", "Daniel"));
response.write(jiraSession.transition("10005", "4"));
response.write(jiraSession.getTransitions("10005"));
response.write(jiraSession.notifyOnIssue("10005", "Testing",
"Damn, Daniel! It Works!", ["Daniel", "Will"]));
response.write(jiraSession.addComment("10005", "Anthony's test comment"));
// Send the response body "Hello World"
response.end('Hello World\n');
}).listen(8000);
// Print URL for accessing server
console.log('Server running at http://127.0.0.1:8000/')