azat-co / practicalnode Goto Github PK
View Code? Open in Web Editor NEWPractical Node.js, 1st and 2nd Editions [Apress] ๐
Home Page: http://practicalnodebook.com
Practical Node.js, 1st and 2nd Editions [Apress] ๐
Home Page: http://practicalnodebook.com
In the book, there is no mention how to download the javascripts/css files, e.g. bower install bootstrap#3.0.2
and bower install jquery#2.0.3
. And if one follows the coding instructions without checking out the git source code, one does not see the final UI.
Also missing documentation: how to compile styl
files to css
. (e.g. stylus -w public/css/style.styl
)
I noticed that blog.js is empty.
A note in its repository says:
As of September 10, 2015, this version of the Document SDK will be deprecated in favor of the AWS.DynamoDB.DocumentClient in the official AWS SDK for JavaScript
I believe examples should be updated...
Replace Derby example with Meteor in code and text (chapter 9)
I'm having the same issue as in #5
I have set my consumer key and consumer secret as appropriate in Makefile
Could you please go through what settings/permissions the Twitter app requires?
Even a very short and simple step-by-step of creating the app and setting up the permissions would be enough to get this working so we can continue reading the book!
I'm a bit confused by this section. After "However, it's trivial to write your own middleware..." well, an example of a middleware to route by query string arguments is given. And then it says: "The request handler itself (index.js
, in this case) is straightforward".
What index.js
? The example was not mentioned as being in an index.js file. After all, is an example of something not included in express cli generated project. Is it the index.js
in the routes
folder? The one shown later is actually users.js
.
Hello,
I just wanted to point out that the images on the chapiter 2 are not displayed. The link to the images are not correct (only a capital letter which should not be there).
Otherwise, awesome content, thank you for your work ;)
https://github.com/azat-co/practicalnode/blob/master/chapter1/chapter1.md#prototypal-nature
var user = function (ops) {
return { firstName: ops.name || 'John'
, lastName: ops.name || 'Doe'
, email: ops.email || '[email protected]'
, name: function() { return this.firstName + this.lastName}
}
}
var agency = function(ops) {
ops = ops || {}
var agency = user(ops)
agency.customers = ops.customers || 0
agency.isAgency = true
return agency
}
should be
var user = function (ops) {
return { firstName: ops.firstName || 'John'
, lastName: ops.lastName || 'Doe'
, email: ops.email || '[email protected]'
, name: function() { return this.firstName + this.lastName}
}
}
var agency = function(ops) {
ops = ops || {}
var agency = user(ops)
agency.customers = ops.customers || 0
agency.isAgency = true
return agency
}
Is there anybody who can explain how to go about updating this to the newest versions of each module? I installed them, and got the server running, but then when I try to visit the port, I get some errors. If anybody's tried this, and could share their experience, I'd appreciate that.
"Produces the following HTML code: hello </h1><p>Welcome to the Practical Node.js!</p>"
Mongoose is an ODM instead.
many files are missing in every chapters. kindly update the repo
Replace Grunt example with Webpack (Hot Module Replacement) in code and text (chapter 10)
The following path 'chapter1/media/Homebrew is causing the git checkout to fail and therefore the cloning succeeds but deletes the contents right after.
Moving the file mongo-skin.js
to the folder blog-express/
and running node mongo-skin.js
gives the following error:
(Using Node.js v0.10.31 and mongoDB 2.6.4)
db.collection('messages').findOneAndAddText('hi', function(count, id){
^
TypeError: Object #<SkinClass> has no method 'findOneAndAddText'
at Object.<anonymous> (/.../practicalnode/ch5/blog-express/mongo-skin.js:26:27)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
the end's callback function is always be passed two arguments err and response; if no error occurred, the first argument will be null;
request
.get('..')
.end(function(err, res){
});
This error appear in 155th page of this book.
As of Feb 11th 2020, request is fully deprecated
(https://www.npmjs.com/package/request).
See also: request/request#3142.
Therefore, I propose to remove them from suggested alternatives.
If you agree, I've opened a PR: #63
Somebody deleted video you are linking to.
Varnish Cache video(link)
The display URL (https://github.com/maxogden/art-of-node%23callbacks) at Taming Callbacks in Node.js is invalid. However Callbacks refers to the right URL(https://github.com/maxogden/art-of-node#callbacks).
http://stackoverflow.com/questions/26922125/node-js-post-causes-error
0 down vote favorite
I am running this app. the only change is twitter consumer key and secret I made in app.js file
I can run this app and sign-in with twitter. But when I try to post an article it causes error.
Connect
400 Error: request size did not match content length
at makeError (/home/myname/Documents/nodejs/practicalnode/ch7/blog-express/node_modules/body-parser/node_modules/raw-body/index.js:136:15)
at IncomingMessage.onEnd (/home/myname/Documents/nodejs/practicalnode/ch7/blog-express/node_modules/body-parser/node_modules/raw-body/index.js:106:13)
at IncomingMessage.g (events.js:180:16)
at IncomingMessage.emit (events.js:92:17)
at _stream_readable.js:938:16
at process._tickCallback (node.js:419:13)
What should I check?what could be wrong. thanks
I think you can talk about node security as well. that would be really interesting.
At: https://github.com/azat-co/practicalnode/blob/master/Chapter11/chapter11.md#caching-with-varnish
The following link is broken:
Varnish Cache video (http://youtu.be/x7t2Sp174eI)
This section of code in admin.js calls both remove and update functions, causing a 500 server error because the document gets deleted and when the update function runs it tries to edit a document that doesn't exist.
$(document.ready(function(){
var
$element.on('click','button.remove', remove);
$element.on('click','button', update);
}
I had to change it to:
$element.on('click', 'button.remove', remove);
$element.on('click', 'button.publish', update);
$element.on('click', 'button.unpublish', update);
I'm sure there is a better way to do this
If one:
./db/seed.sh
from the git project.make test
from the book project.then one test will fail because the first article in the book ends with to improve network coverage...
and it does not match the string from the git project to improve network coverage.
Possible solution is to finish the article sentence in the book with a dot, even when the strings are longer.
do you have any plan for todo List?
Please vote on these topics to be included into the 2nd edition:
Using the source code from git and the recommended start.sh
from the book, when I try to sign in with Twitter, I get a 500 error from Express. (Key, Secret and Twitter name are set)
Console output:
starting step - getRequestToken
undefined
GET /auth/twitter 500 5898ms
Mongoose is an ODM instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.