https://github.com/smv1999/learnnodejs
https://github.com/smv1999/learnnodejs
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/smv1999/learnnodejs
- Owner: smv1999
- Created: 2020-05-10T15:17:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-10T16:30:12.000Z (over 5 years ago)
- Last Synced: 2025-01-28T19:13:37.804Z (8 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LearnNodeJS
## Node JS Intro
* Node.js is an open source server environment
* Node.js uses JavaScript on the server
* Node.js can generate dynamic page content
* Node.js can create, open, read, write, delete, and close files on the server
* Node.js can add, delete, modify data in your database## Hello World in Node JS
```var http = require('http');http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('Hello World!');
}).listen(8080);
```
* Name the above file as index.js
* Initiate the node js file as follows:
```node index.js```
* Now open your browser and type localhost:8080 and you should see the "Hello World" as output.## Modules in Node JS
* Look at the list of built-in modules here: https://www.w3schools.com/nodejs/ref_modules.asp