-
Notifications
You must be signed in to change notification settings - Fork 0
Phone book #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Phone book #23
Changes from all commits
c8a4158
c89689d
0760941
23f8556
62e7353
3ab6d6e
d22bbbe
73d31a3
d0d6f07
7b18c4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,9 +11,17 @@ | |
| </head> | ||
|
|
||
| <body> | ||
| <div class="container-holder"></div> | ||
| <div id="app"></div> | ||
|
|
||
| <script src="src/users.js"></script> | ||
| <script src="src/router.js"></script> | ||
| <script src="src/server-api.js"></script> | ||
| <!-- <script src="src/contacts.js"></script> --> | ||
| <script src="src/contacts.js"></script> | ||
| <script src="src/keypad.js"></script> | ||
| <script src="src/edit-user.js"></script> | ||
| <script src="src/user.js"></script> | ||
| <!-- <script src="src/add-user.js"></script> --> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what the status of that script? it's better to remove commented code. The commented code just makes discouraged the next developer who inspect such code |
||
| <script src="src/app.js"></script> | ||
| </body> | ||
| </html> | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| const http = require('http'); | ||
| const fs = require('fs'); | ||
| const port = 3000; | ||
|
|
||
| http.createServer( (request, response) =>{ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ideally, you need your own server only for development purpose, so you could use some instruments like webpack-dev-server or so |
||
| let path = request.url; | ||
| if(path.indexOf('html') != -1 || path == '/'){ | ||
| path = '/index.html'; | ||
| } | ||
| // path = '/index.html'; | ||
|
|
||
| let source = ''; | ||
| if (fs.existsSync('.' + path)) { | ||
| source = fs.readFileSync('.' + path); | ||
| }else{ | ||
| source = 'no such resource'; | ||
| response.statusCode = 404; | ||
| } | ||
| response.end(source); | ||
| }).listen(port, (err) => { | ||
| if (err) { | ||
| return console.log('something bad happened', err); | ||
| } | ||
| console.log(`server is listening on ${port}`) | ||
| }) | ||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's seems like an a duplication with line 20, please remove it