See the following link:
https://docs.nodejitsu.com/articles/HTTP/clients/how-to-create-a-HTTP-request
Also see David Walsh's blog:
https://davidwalsh.name/nodejs-http-request
Sunday, November 22, 2015
Saturday, November 21, 2015
Friday, November 20, 2015
Reading a Text String into an Array Project
Split a string object into an array of strings:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split
Substitute '+' characters for spaces in each array element:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
Work with the Array:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/split
Substitute '+' characters for spaces in each array element:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace
Work with the Array:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
Thursday, November 19, 2015
Tuesday, November 10, 2015
The Simple Example with the ldnode.
I spent some time in the past two months looking at https://github.com/linkeddata/ldnode . To get it working, I needed to fix a contextify issue https://github.com/linkeddata/ldnode/issues/139 which required downgrading node to version 0.12.7. When I moved to the simple example at https://github.com/linkeddata/ldnode/blob/master/README.md I needed to set up PEM files http://how2ssl.com/articles/working_with_pem_files/
titled sslKey.pem and sslCert.pem. I did this by creating a self-signed key described in OpenSSL commands and tips http://how2ssl.com/articles/openssl_commands_and_tips/ .
I needed to set the paths to my PEM files as well as the ldnode module. It was done wit h the following code (simple.js):
var ldnode = require('../../../usr/local/lib/node_modules/ldnode')
var ldp = ldnode.createServer({
key: './sslKey.pem',
cert: './sslCert.pem',
webid: true
})
ldp.listen(3000, function() {
// Started Linked Data Platform
})
When this was running from the bash CLI in Ubuntu 15.04 with node simple.js at the prompt I got a blinking cursor. I am assuming that the code did what it supposed to since it generated no errors. Of course, I had no way to peer inside as it spit nothing to the screen or a browser. http://localhost:3000 was inacessible. I will have to review node behaviour, such as through Ryan Dahl's tutorial, https://www.youtube.com/watch?v=eqlZD21DME0 , and through OK Coders JavaScript and Express App demo https://github.com/okcoders/ok-coders-summer-2014 as well as OK Coders YouTube videos https://www.youtube.com/channel/UCR_oQSBmHvtq8KGOWtJWygA.
.
titled sslKey.pem and sslCert.pem. I did this by creating a self-signed key described in OpenSSL commands and tips http://how2ssl.com/articles/openssl_commands_and_tips/ .
I needed to set the paths to my PEM files as well as the ldnode module. It was done wit h the following code (simple.js):
var ldnode = require('../../../usr/local/lib/node_modules/ldnode')
var ldp = ldnode.createServer({
key: './sslKey.pem',
cert: './sslCert.pem',
webid: true
})
ldp.listen(3000, function() {
// Started Linked Data Platform
})
When this was running from the bash CLI in Ubuntu 15.04 with node simple.js at the prompt I got a blinking cursor. I am assuming that the code did what it supposed to since it generated no errors. Of course, I had no way to peer inside as it spit nothing to the screen or a browser. http://localhost:3000 was inacessible. I will have to review node behaviour, such as through Ryan Dahl's tutorial, https://www.youtube.com/watch?v=eqlZD21DME0 , and through OK Coders JavaScript and Express App demo https://github.com/okcoders/ok-coders-summer-2014 as well as OK Coders YouTube videos https://www.youtube.com/channel/UCR_oQSBmHvtq8KGOWtJWygA.
.
Subscribe to:
Posts (Atom)