I finally decided "try" learn a little node.js.
So i installed according to. https://nodejs.org/en/docs/guides/getting-started-guide/
And simply copied app.js to my intetpub directory.
But visiting 127.0.0.1:3000 there is nothing.
Must i configure IIS to listen to app.js as start page "index.html"
What happens if i invoke app.js as a script src within index.html?
Can i mix up the node.js code with my vanilla just import them as script SRC?
On Thursday, 14 October 2021 at 04:24:19 UTC+2, jonas.t...@gmail.com wrote:system paths).
I finally decided "try" learn a little node.js.
So i installed according to. https://nodejs.org/en/docs/guides/getting-started-guide/
And simply copied app.js to my intetpub directory.That's not what it says: wherever you put app.js, and assuming you have node in your path, you launch it with "node app.js" from the command line after cd-ing to where the file is (in this case: of course you can also use relative and absolute file
Node's object model and libraries.But visiting 127.0.0.1:3000 there is nothing.
Must i configure IIS to listen to app.js as start page "index.html"No, Node is the server here: you are literally writing the code that handles http requests and returns the http responses, your own web server that is... (I suggest you sat with Express, if you don't want to reinvent a lot of wheels).
What happens if i invoke app.js as a script src within index.html?You get runtime errors, it's just not written for the browser context.
Can i mix up the node.js code with my vanilla just import them as script SRC?You can have js files where you put some general logic that you want to reuse, and that of course you can share. The rest cannot be shared, one works in the context of a browser hence the various browser DOM's, the other is in the context of Node and
HTH,const http = require('http');
Julio
On Thursday, 14 October 2021 at 04:24:19 UTC+2, jonas.t...@gmail.com wrote:system paths).
I finally decided "try" learn a little node.js.
So i installed according to. https://nodejs.org/en/docs/guides/getting-started-guide/
And simply copied app.js to my intetpub directory.That's not what it says: wherever you put app.js, and assuming you have node in your path, you launch it with "node app.js" from the command line after cd-ing to where the file is (in this case: of course you can also use relative and absolute file
Node's object model and libraries.But visiting 127.0.0.1:3000 there is nothing.
Must i configure IIS to listen to app.js as start page "index.html"No, Node is the server here: you are literally writing the code that handles http requests and returns the http responses, your own web server that is... (I suggest you sat with Express, if you don't want to reinvent a lot of wheels).
What happens if i invoke app.js as a script src within index.html?You get runtime errors, it's just not written for the browser context.
Can i mix up the node.js code with my vanilla just import them as script SRC?You can have js files where you put some general logic that you want to reuse, and that of course you can share. The rest cannot be shared, one works in the context of a browser hence the various browser DOM's, the other is in the context of Node and
HTH,I am not sure what braindead monkey wrote that intro but....
Julio
On Thursday, 14 October 2021 at 04:24:19 UTC+2, jonas.t...@gmail.com wrote: >> > I finally decided "try" learn a little node.js.
So i installed according to.
https://nodejs.org/en/docs/guides/getting-started-guide/
And simply copied app.js to my intetpub directory.
I am not sure what braindead monkey wrote that intro but....
"Now, run your web server using node app.js. Visit
http://localhost:3000 and you will see a message saying "Hello World".
Jonas Thörnvall <jonas.t...@gmail.com> writes:Well i am all about the easy way, both doing an explaining. But as you say run your webserver using node app.js just isn't sufficial.
On Thursday, 14 October 2021 at 04:24:19 UTC+2, jonas.t...@gmail.com wrote:I am not sure what braindead monkey wrote that intro but....
I finally decided "try" learn a little node.js.
So i installed according to.
https://nodejs.org/en/docs/guides/getting-started-guide/
And simply copied app.js to my intetpub directory.
"Now, run your web server using node app.js. VisitThe phrase "run your web server using node app.js", with "node app.js" highlighted so it is visually distinct form the English text, will be understood by most readers to mean that you have to run a program (node) passing it an argument (app.js) however it is that you do such things on your system.
http://localhost:3000 and you will see a message saying "Hello World".
It's not absurd that you did not know what was meant, but it's very rude
to conclude that the fault is entirely that of the "braindead monkey"
who wrote this one-page quick guide.
--
Ben.
torsdag 14 oktober 2021 kl. 12:18:05 UTC+2 skrev Ben Bacarisse:[...]
Jonas Thörnvall <jonas.t...@gmail.com> writes:
On Thursday, 14 October 2021 at 04:24:19 UTC+2,
jonas.t...@gmail.com wrote:
I finally decided "try" learn a little node.js. So i
installed according to.
https://nodejs.org/en/docs/guides/getting-started-guide/
Well i am all about the easy way, both doing an explaining. But as
you say run your webserver using node app.js just isn't sufficial. At
least run "node app.js" to make some context, because node is an
executable and the argument passed is app.js.
So better yet would been run node.exe with parameter app.js from
directory where app.js resides. Well if "node.exe" path is known...
Ok braindead monkey was a bit harsch i really meant parrot LoL
Well i understand howto "echo" information from server now, but i do
not quite remember howto request things using client "browser". I
remember that i in PHP did fetch information from a database using
forms and input fields that was dynamically created, so i must sent
requests via javascript to server? But i do not remember what such a
call "request" looked like.
How would i done the above as a request, via a HTML page with script,
for example a button push echoed answer to textarea?
Jonas Thörnvall:Well evidently the requests was simpler then i expected/remember.
Well i understand howto "echo" information from server now, but i doThen learn it!
not quite remember howto request things using client "browser". I
The things you need to understand:
- HTTP
- URL
- query parameters
- CGI
remember that i in PHP did fetch information from a database usingYou just send a request with your browser and the server will process
forms and input fields that was dynamically created, so i must sent requests via javascript to server? But i do not remember what such a
call "request" looked like.
it. This request can be:
- URL with or without any query parameter (<a href="...">...</a>).
- A form which gets submitted (<form action="..." ...></form>)
- An XHR request using JavaScript
How would i done the above as a request, via a HTML page with script,Go and get a book about how HTTP, CGI etc. works. To explain this *here*
for example a button push echoed answer to textarea?
is WAY OFF TOPIC!
--
Arno Welzel
https://arnowelzel.de
I am not sure what braindead monkey wrote that intro but....
"Now, run your web server using node app.js. Visit
http://localhost:3000 and you will see a message saying "Hello
World". Refer to the Introduction to Node.js for a more comprehensive
guide to getting started with Node.js."
But i think he left out a couple of steps, like it should be run from commandline, i got it running now.
Is it something similar to PHP, must the whole code base "vanilla
javascript" be generated dynamically thru the server? Or can i from
the clientside script invole functionality from server?
torsdag 14 oktober 2021 kl. 12:18:05 UTC+2 skrev Ben Bacarisse:
Jonas Thörnvall <jonas.t...@gmail.com> writes:
The phrase "run your web server using node app.js", with "node app.js"On Thursday, 14 October 2021 at 04:24:19 UTC+2, jonas.t...@gmail.com wrote:I am not sure what braindead monkey wrote that intro but....
I finally decided "try" learn a little node.js.
So i installed according to.
https://nodejs.org/en/docs/guides/getting-started-guide/
And simply copied app.js to my intetpub directory.
"Now, run your web server using node app.js. Visit
http://localhost:3000 and you will see a message saying "Hello World".
highlighted so it is visually distinct form the English text, will be
understood by most readers to mean that you have to run a program (node)
passing it an argument (app.js) however it is that you do such things on
your system.
It's not absurd that you did not know what was meant, but it's very rude
to conclude that the fault is entirely that of the "braindead monkey"
who wrote this one-page quick guide.
Well i am all about the easy way, both doing an explaining. But as you
say run your webserver using node app.js just isn't sufficial.
At least run "node app.js" to make some context, because node is an executable and the argument passed is app.js.
So better yet would been run node.exe with parameter app.js from
directory where app.js resides.
Jonas Thörnvall <jonas.t...@gmail.com> writes:Ok let settle for "run" so that the reader understand it is an executable binary "running in some environment"
torsdag 14 oktober 2021 kl. 12:18:05 UTC+2 skrev Ben Bacarisse:
Jonas Thörnvall <jonas.t...@gmail.com> writes:
highlighted so it is visually distinct form the English text, will beOn Thursday, 14 October 2021 at 04:24:19 UTC+2, jonas.t...@gmail.com wrote:I am not sure what braindead monkey wrote that intro but....
I finally decided "try" learn a little node.js.
So i installed according to.
https://nodejs.org/en/docs/guides/getting-started-guide/
And simply copied app.js to my intetpub directory.
"Now, run your web server using node app.js. Visit
http://localhost:3000 and you will see a message saying "Hello World". >> The phrase "run your web server using node app.js", with "node app.js"
understood by most readers to mean that you have to run a program (node) >> passing it an argument (app.js) however it is that you do such things on >> your system.
It's not absurd that you did not know what was meant, but it's very rude >> to conclude that the fault is entirely that of the "braindead monkey"
who wrote this one-page quick guide.
Well i am all about the easy way, both doing an explaining. But as youI didn't think that that is what I said.
say run your webserver using node app.js just isn't sufficial.
At least run "node app.js" to make some context, because node is an executable and the argument passed is app.js.That's what the coloured background is supposed to suggest. There's no obvious reason to suppose that quotes are clearer, especially as if you
were to actually write the quotes it would not work.
So better yet would been run node.exe with parameter app.js fromExcept that would be confusing when the program is called node rather
directory where app.js resides.
than node.exe. As you can see, it's not easy to cater for every
possible misunderstanding.
--
Ben.
torsdag 14 oktober 2021 kl. 16:02:59 UTC+2 skrev Ben Bacarisse:run "node" from commandline/shell with "app.js" as argument/parameter would been nice.... in this context...
Jonas Thörnvall <jonas.t...@gmail.com> writes:
torsdag 14 oktober 2021 kl. 12:18:05 UTC+2 skrev Ben Bacarisse:
Jonas Thörnvall <jonas.t...@gmail.com> writes:
The phrase "run your web server using node app.js", with "node app.js" >> highlighted so it is visually distinct form the English text, will be >> understood by most readers to mean that you have to run a program (node)On Thursday, 14 October 2021 at 04:24:19 UTC+2, jonas.t...@gmail.com wrote:I am not sure what braindead monkey wrote that intro but....
I finally decided "try" learn a little node.js.
So i installed according to.
https://nodejs.org/en/docs/guides/getting-started-guide/
And simply copied app.js to my intetpub directory.
"Now, run your web server using node app.js. Visit
http://localhost:3000 and you will see a message saying "Hello World".
passing it an argument (app.js) however it is that you do such things on
your system.
It's not absurd that you did not know what was meant, but it's very rude
to conclude that the fault is entirely that of the "braindead monkey" >> who wrote this one-page quick guide.
Well i am all about the easy way, both doing an explaining. But as you say run your webserver using node app.js just isn't sufficial.I didn't think that that is what I said.
At least run "node app.js" to make some context, because node is an executable and the argument passed is app.js.That's what the coloured background is supposed to suggest. There's no obvious reason to suppose that quotes are clearer, especially as if you were to actually write the quotes it would not work.
So better yet would been run node.exe with parameter app.js from directory where app.js resides.Except that would be confusing when the program is called node rather
than node.exe. As you can see, it's not easy to cater for every
possible misunderstanding.
--Ok let settle for "run" so that the reader understand it is an executable binary "running in some environment"
Ben.
I think use and webserver is vague in this context.
torsdag 14 oktober 2021 kl. 09:12:43 UTC+2 skrev ju...@diegidio.name:<snip>
"Now, run your web server using node app.js. Visit http://localhost:3000 and you will see a message saying "Hello World".
Refer to the Introduction to Node.js for a more comprehensive guide to getting started with Node.js."
But i think he left out a couple of steps, like it should be run from commandline, i got it running now.
Is it something similar to PHP, must the whole code base "vanilla javascript" be generated dynamically thru the server?
Or can i from the clientside script invole functionality from server?
For example have a "vanilla script" ask a "node.js" server script what time it is from "browser script"?
I just try to get a hang out of how you use it, i do not exactly remember how PHP did work but i think it mostly was generated dynamically at server, and you sent request strings?
I am not sure what braindead monkey wrote that intro but....
"Now, run your web server using node app.js. Visit http://localhost:3000
and you will see a message saying "Hello World". [ ... ]
But i think he left out a couple of steps, like it should be run from commandline, i got it running now.
Every now and then I ask myself why I stopped actively participating in comp.lang.javascript...To be honest Scott i am a bit surprised they chosed the same extension for serverside and clientside javascript.
jonas.t...@gmail.com wrote:
I am not sure what braindead monkey wrote that intro but....
"Now, run your web server using node app.js. Visit http://localhost:3000 and you will see a message saying "Hello World". [ ... ]
But i think he left out a couple of steps, like it should be run from commandline, i got it running now.... Then I remember.
:-(
-- Scott
Every now and then I ask myself why I stopped actively participating in comp.lang.javascript...
jonas.thornvall@gmail.com wrote:
I am not sure what braindead monkey wrote that intro but....
"Now, run your web server using node app.js. Visit http://localhost:3000
and you will see a message saying "Hello World". [ ... ]
But i think he left out a couple of steps, like it should be run from
commandline, i got it running now.
... Then I remember.
:-(
On 2021-10-16, Scott Sauyet <scott....@gmail.com> wrote:
Every now and then I ask myself why I stopped actively participating in comp.lang.javascript...
jonas.t...@gmail.com wrote:
I am not sure what braindead monkey wrote that intro but....
"Now, run your web server using node app.js. Visit http://localhost:3000 >> and you will see a message saying "Hello World". [ ... ]
But i think he left out a couple of steps, like it should be run from
commandline, i got it running now.
... Then I remember.
:-(It's ok with an appropriate kill-file...
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 354 |
Nodes: | 16 (2 / 14) |
Uptime: | 40:59:13 |
Calls: | 7,650 |
Calls today: | 2 |
Files: | 12,811 |
Messages: | 5,699,701 |