Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions week1/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
"env": {
"browser": true,
"es6": true
},
"extends": "eslint:recommended",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"rules": {
}
};
16 changes: 16 additions & 0 deletions week1/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems like you have 2 .eslintrc.json, one is enough. You can have several eslint configuratons files if you want for example the project to follow some rules, but maybe tests should follow different rules.

"env": {
"browser": true,
"commonjs": true,
"es6": true
},
"extends": "standard",
"globals": {
"Atomics": "readonly",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are not using the variables declared here in the globals

"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {}
}
54 changes: 54 additions & 0 deletions week1/Ivysproject/testingNode.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// //the following has been imported from https://date-fns.org/ and import with const

// const { format, formatDistance, formatRelative, subDays } from 'date-fns'

// function hello() {
// const now= new Date()
// format(now(), "'Today is a' iiii")
// //=> "Today is a Sunday"

// formatDistance(subDays(new Date(), 3), now())
// //=> "3 days ago"

// formatRelative(subDays(new Date(), 3), now())
// //=> "last Friday at 7:26 p.m."
// console.log('Hello World');
// }
// hello()

//creating a server:
var http = require('http'); //

//create a server object:
function createServer() {
const server = http.createServer(function(req, res) {
//creates a function called http that has a response and request parameter
res.write('Hello World!'); //write a response to the client
res.end(); //end the response
});
server.listen(8080); //the server object listens on port 8080. Once the server is created, is says: listen to port 8080

console.log('service started on http://localhost:8080');
}
createServer();

//*******************
//creating a json

// function createServer() {
// const server = http.createServer(function (req, res) {
// if (req.url == "/hello"{
// res.writeHead(200, { "Content-Type": "application/json" });
// res.write(JSON.stringify({ greeting: "Hello World!" })); //write a response to the client
// res.end(); //end the response
// }else {
// res.writeHead(404, { "Content-Type": "application/json" });
// res.write(JSON.stringify({ error: "Error" })); //write a response to the client
// }
// res.end(); //end the response
// })
// server.listen(8080); //the server object listens

// //console.log('service started on http://localhost:8080');
// }
// createServer();
Loading