Skip to content

Commit

Permalink
Understanding basics of node.js
Browse files Browse the repository at this point in the history
  • Loading branch information
philwing100 committed Jun 18, 2024
1 parent 81c994c commit 4b67d05
Show file tree
Hide file tree
Showing 9 changed files with 115 additions and 7 deletions.
6 changes: 6 additions & 0 deletions backend/demofile1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<html>
<body>
<h1>My Header</h1>
<p>AUGH</p>
</body>
</html>
20 changes: 16 additions & 4 deletions backend/myfirstnodefile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
var http = require('http');
var url = require('url');
var fs = require('fs');

http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end('Hello World!');
}).listen(8080);
http.createServer(function(req,res){
var q = url.parse(req.url, true);
var filename = "." + q.pathname;
fs.readFile(filename,function(err,data){
if (err){
res.writeHead(404, {'Content-Type': 'text/html'});
return res.end("404 Not Found");
}
res.writeHead(200,{'Content-Type': 'text/html'});
res.write(data);
return res.end();
});
}).listen(8080);
//https://nodejs.org/en/learn/asynchronous-work/the-nodejs-event-emitter https://www.theodinproject.com/lessons/nodejs-introduction-to-express
40 changes: 40 additions & 0 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{"dependencies":{"nodemailer":"^6.9.13"}}

1 change: 1 addition & 0 deletions backend/summer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html><body><h1>Summer</h1><p>I love the sun!</p></body></html>
1 change: 1 addition & 0 deletions backend/winter.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html><body><h1>Winter</h1><p>I love the snow!</p></body></html>
1 change: 1 addition & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
]
}
}

49 changes: 46 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"core-js": "^3.8.3",
"express": "^4.18.2",
"firebase": "^10.12.1",
"formidable": "^3.5.1",
"nodemailer": "^6.9.13",
"vue": "^3.2.13",
"vue-router": "^4.0.3",
"vuedraggable": "^4.1.0"
Expand Down

0 comments on commit 4b67d05

Please sign in to comment.